Skip to content

Commit

Permalink
Merge pull request #12183 from nextcloud/backport/12178/stable29
Browse files Browse the repository at this point in the history
[stable29] fix(messagesStore): compare message ids as numeric values
  • Loading branch information
Antreesy authored Apr 22, 2024
2 parents 778f2ab + a7afcfb commit 08f3bca
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 08f3bca

Please sign in to comment.