1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-09-02 03:10:56 +00:00

Make changes to how forceUpdate() is called to hopefully reduce errors with React being stupid and not understanding how the DOM works. Also don't display an empty message for a resub with no attached message.

This commit is contained in:
SirStendec 2018-03-01 04:13:52 -05:00
parent 67053e3804
commit fb1ea38f1b
6 changed files with 29 additions and 12 deletions

View file

@ -100,7 +100,7 @@ export default class ChatLine extends Module {
const tokens = msg.ffz_tokens = msg.ffz_tokens || t.chat.tokenizeMessage(msg, {login: this.props.currentUserLogin, display: this.props.currentUserDisplayName});
let cls = 'chat-line__message',
out = tokens.length ? [
out = (tokens.length || ! msg.ffz_type) ? [
this.props.showTimestamps && e('span', {
className: 'chat-line__timestamp'
}, t.chat.formatTime(msg.timestamp)),
@ -212,8 +212,9 @@ export default class ChatLine extends Module {
}, out);
}
for(const inst of instances)
inst.forceUpdate();
// Do this after a short delay to hopefully reduce the chance of React
// freaking out on us.
setTimeout(() => this.ChatLine.forceUpdate());
})
}
@ -223,9 +224,9 @@ export default class ChatLine extends Module {
const msg = inst.props.message;
if ( msg )
msg.ffz_tokens = null;
inst.forceUpdate();
}
this.ChatLine.forceUpdate();
}
}