Browse Source

logs-content: Fixed character names being omitted on multipart posts where an action post follows a text post.

1.2
Gisle Aune 5 years ago
parent
commit
b952007f3b
  1. 2
      marko/page/logs-content/components/post/component.js
  2. 2
      marko/page/logs-content/components/post/index.marko

2
marko/page/logs-content/components/post/component.js

@ -13,6 +13,7 @@ module.exports = class {
removed: false,
multipart: false,
anchored: false,
prevWasText: false,
}
this.mounted = false;
@ -48,6 +49,7 @@ module.exports = class {
const timediff = Date.parse(input.post.time) - Date.parse(input.prev.time)
this.state.multipart = (input.post.nick == input.prev.nick && input.prev.multipart !== false) && (Math.abs(timediff) < 60000);
this.state.prevWasText = (input.prev.kind === "text");
this.updatePost(input)
}

2
marko/page/logs-content/components/post/index.marko

@ -26,7 +26,7 @@
<markdown class="post-content post-scene" source=state.text />
</div>
<div if(input.post.kind === "action") class="post-body color-text">
$ const prefix = (!state.multipart ? state.shortName + state.nameSuffix + " " : "");
$ const prefix = ((!state.multipart || state.prevWasText) ? state.shortName + state.nameSuffix + " " : "");
<markdown class="post-content post-action" source=(prefix + state.text) />
</div>
<div if(input.post.kind === "text") class="post-body color-text">

Loading…
Cancel
Save