зеркало из https://github.com/nextcloud/spreed.git
Don't mark conversation as read any more on click
When joining a conversation, don't mark it as read any more. The only moment will be when scrolling down to the bottom of a conversation and when clearing the read marker, in which case we immediately update the store. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
This commit is contained in:
Родитель
c4e739c9a1
Коммит
6929de8b6c
|
@ -427,7 +427,6 @@ export default {
|
|||
|
||||
// this.$store.dispatch('purgeConversationsStore')
|
||||
this.$store.dispatch('addConversation', response.data.ocs.data)
|
||||
this.$store.dispatch('markConversationRead', token)
|
||||
|
||||
/**
|
||||
* Emits a global event that is used in App.vue to update the page title once the
|
||||
|
|
|
@ -264,7 +264,6 @@ export default {
|
|||
|
||||
const response = await fetchConversation(this.token)
|
||||
this.$store.dispatch('addConversation', response.data.ocs.data)
|
||||
this.$store.dispatch('markConversationRead', this.token)
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -167,7 +167,6 @@ export default {
|
|||
try {
|
||||
const response = await fetchConversation(this.token)
|
||||
this.$store.dispatch('addConversation', response.data.ocs.data)
|
||||
this.$store.dispatch('markConversationRead', this.token)
|
||||
|
||||
// Although the current participant is automatically added to
|
||||
// the participants store it must be explicitly set in the
|
||||
|
|
|
@ -203,7 +203,6 @@ export default {
|
|||
try {
|
||||
const response = await fetchConversation(this.token)
|
||||
this.$store.dispatch('addConversation', response.data.ocs.data)
|
||||
this.$store.dispatch('markConversationRead', this.token)
|
||||
|
||||
// Although the current participant is automatically added to
|
||||
// the participants store it must be explicitly set in the
|
||||
|
|
|
@ -115,7 +115,6 @@ export default {
|
|||
}
|
||||
if (to.name === 'conversation') {
|
||||
joinConversation(to.params.token)
|
||||
this.$store.dispatch('markConversationRead', to.params.token)
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -442,9 +442,6 @@ export default {
|
|||
this.$store.dispatch('purgeConversationsStore')
|
||||
conversations.data.ocs.data.forEach(conversation => {
|
||||
this.$store.dispatch('addConversation', conversation)
|
||||
if (conversation.token === this.$store.getters.getToken()) {
|
||||
this.$store.dispatch('markConversationRead', this.$store.getters.getToken())
|
||||
}
|
||||
})
|
||||
/**
|
||||
* Emits a global event that is used in App.vue to update the page title once the
|
||||
|
|
|
@ -332,6 +332,7 @@ const actions = {
|
|||
}
|
||||
// set the id to the last message
|
||||
context.dispatch('updateLastReadMessage', { token, id: conversation.lastMessage.id })
|
||||
context.dispatch('markConversationRead', token)
|
||||
},
|
||||
|
||||
async updateLastReadMessage(context, { token, id = 0 }) {
|
||||
|
@ -343,6 +344,8 @@ const actions = {
|
|||
// optimistic early commit to avoid indicator flickering
|
||||
context.commit('updateConversationLastReadMessage', { token, lastReadMessage: id })
|
||||
await updateLastReadMessage(token, id)
|
||||
|
||||
// TODO: update unread counters if possible (otherwise user needs to wait for conversation list refresh)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче