Skip to content

Commit f53f57e

Browse files
committed
fixup! fix(conversationsStore): do not purge 'history_cleared' when clearing messages history
1 parent 0baa634 commit f53f57e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/store/conversationsStore.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -537,11 +537,12 @@ const actions = {
537537
chatExtrasStore.removeParentIdToReply(token)
538538
const reactionsStore = useReactionsStore()
539539
reactionsStore.purgeReactionsStore(token)
540-
const sharedItemsStore = useSharedItemsStore()
541-
sharedItemsStore.purgeSharedItemsStore(token)
542-
chatExtrasStore.clearThreads(token)
543-
context.commit('clearMessagesHistory', { token, id: response.data.ocs.data.id })
544-
context.commit('addMessage', { token, message: response.data.ocs.data })
540+
context.dispatch('processMessage', { token, message: response.data.ocs.data })
541+
context.dispatch('updateLastReadMessage', {
542+
token,
543+
id: response.data.ocs.data.id,
544+
updateVisually: true,
545+
})
545546
} catch (error) {
546547
console.error(t('spreed', 'Error while clearing conversation history'), error)
547548
}

src/store/messagesStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ const actions = {
600600
if (message.systemMessage === MESSAGE.SYSTEM_TYPE.HISTORY_CLEARED) {
601601
sharedItemsStore.purgeSharedItemsStore(token, message.id)
602602
chatExtrasStore.clearThreads(token, message.id)
603-
context.commit('clearMessagesHistory', {
603+
context.dispatch('clearMessagesHistory', {
604604
token,
605605
id: message.id,
606606
})

0 commit comments

Comments
 (0)