From a7afcfb7565ab31fe2a071b0e554efb16c8428ce Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Mon, 22 Apr 2024 10:47:49 +0200 Subject: [PATCH] fix(messagesStore): compare message ids as values of the same type Signed-off-by: Maksim Sukharev --- src/store/messagesStore.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/store/messagesStore.js b/src/store/messagesStore.js index 41737d7bd02..7d13f74d96f 100644 --- a/src/store/messagesStore.js +++ b/src/store/messagesStore.js @@ -504,15 +504,15 @@ const mutations = { return } - const messagesToRemove = messageIds.sort().reverse().slice(199) + const messagesToRemove = messageIds.sort((a, b) => b - a).slice(199) const newFirstKnown = messagesToRemove.shift() messagesToRemove.forEach((messageId) => { Vue.delete(state.messages[token], messageId) }) - if (state.firstKnown[token] && messagesToRemove.includes(state.firstKnown[token])) { - Vue.set(state.firstKnown, token, newFirstKnown) + if (state.firstKnown[token] && messagesToRemove.includes(state.firstKnown[token].toString())) { + Vue.set(state.firstKnown, token, +newFirstKnown) } }, }