Skip to content

Commit

Permalink
fix(messagesStore): compare message ids as values of the same type
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy authored and backportbot[bot] committed Apr 22, 2024
1 parent 778f2ab commit a7afcfb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/store/messagesStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
},
}
Expand Down

0 comments on commit a7afcfb

Please sign in to comment.