ui: fix tabclose events distribution

This commit is contained in:
nick-delirium 2025-02-27 17:48:47 +01:00
parent 19c8fba445
commit e2fa3c91e2
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
2 changed files with 9 additions and 3 deletions

View file

@ -221,8 +221,9 @@ export default class MessageManager {
}
}
lastMsgArr.sort((a, b) => a[1] - b[1]);
lastMsgArr.forEach(([tabId, lastMessageTs]) => {
lastMsgArr
.sort((a, b) => a[1] - b[1])
.forEach(([tabId, lastMessageTs]) => {
this.tabCloseManager.append({ tabId, time: lastMessageTs });
});
};
@ -371,6 +372,9 @@ export default class MessageManager {
this.mouseThrashingManager.append(msg);
break;
case MType.MouseMove:
if (this.tabs[msg.tabId].lastMessageTs < msg.time) {
this.tabs[msg.tabId].lastMessageTs = msg.time;
}
this.mouseMoveManager.append(msg);
break;
case MType.MouseClickDeprecated:

View file

@ -200,7 +200,9 @@ export default class TabSessionManager {
firstTitleSet = false
distributeMessage(msg: Message): void {
this.lastMessageTs = msg.time;
if (this.lastMessageTs < msg.time) {
this.lastMessageTs = msg.time;
}
switch (msg.tp) {
case MType.CanvasNode:
const managerId = `${msg.timestamp}_${msg.nodeId}`;