mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-05 18:48:31 +00:00
4.2.1
Fixed: Chat messages not appearing immediately in some situations.
This commit is contained in:
parent
cebb1c0140
commit
5f41206df8
2 changed files with 13 additions and 3 deletions
|
@ -151,7 +151,7 @@ ${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}`
|
||||||
FrankerFaceZ.Logger = Logger;
|
FrankerFaceZ.Logger = Logger;
|
||||||
|
|
||||||
const VER = FrankerFaceZ.version_info = {
|
const VER = FrankerFaceZ.version_info = {
|
||||||
major: 4, minor: 2, revision: 0,
|
major: 4, minor: 2, revision: 1,
|
||||||
commit: __git_commit__,
|
commit: __git_commit__,
|
||||||
build: __webpack_hash__,
|
build: __webpack_hash__,
|
||||||
toString: () =>
|
toString: () =>
|
||||||
|
|
|
@ -905,6 +905,10 @@ export default class ChatHook extends Module {
|
||||||
if ( ! inst.props.isBackground )
|
if ( ! inst.props.isBackground )
|
||||||
inst.notifySubscribers();
|
inst.notifySubscribers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inst.getMessages = function() {
|
||||||
|
return inst.buffer.slice(0, inst.slidingWindowEnd + (inst.ffz_extra || 0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cls.prototype.componentDidMount = function() {
|
cls.prototype.componentDidMount = function() {
|
||||||
|
@ -927,6 +931,7 @@ export default class ChatHook extends Module {
|
||||||
count = max_size;
|
count = max_size;
|
||||||
|
|
||||||
if ( count <= 0 ) {
|
if ( count <= 0 ) {
|
||||||
|
this.ffz_extra = 0;
|
||||||
this.buffer = [];
|
this.buffer = [];
|
||||||
this.delayedMessageBuffer = [];
|
this.delayedMessageBuffer = [];
|
||||||
this.paused = false;
|
this.paused = false;
|
||||||
|
@ -944,10 +949,15 @@ export default class ChatHook extends Module {
|
||||||
last = i;
|
last = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.buffer = buffer.slice(removed % 2 === 0 ? target : Math.max(target - 4, last));
|
// When we remove less then expected, we want to keep track
|
||||||
|
// of that so we can return the extra messages from getMessages.
|
||||||
|
this.ffz_extra = target - last;
|
||||||
|
this.buffer = buffer.slice(removed % 2 !== 0 ? Math.max(target - 4, last) : target);
|
||||||
|
|
||||||
} else
|
} else {
|
||||||
|
this.ffz_extra = 0;
|
||||||
this.buffer = this.buffer.slice(0);
|
this.buffer = this.buffer.slice(0);
|
||||||
|
}
|
||||||
|
|
||||||
if ( this.paused && this.buffer.length >= 900 )
|
if ( this.paused && this.buffer.length >= 900 )
|
||||||
this.setPaused(false);
|
this.setPaused(false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue