Browse Source

Don't leave conversation on URL hash change

Whenever only the URL hash changes despite the token staying the same, a
route change event is still triggered.

This fix avoids leaving and re-joining the same conversation.

Fixes an issue where clicking a search result would trigger both the
event that leaves the conversation within a route change and a page
unload event, which also leaves the same conversation.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
pull/4593/head
Vincent Petry 5 years ago
parent
commit
36a20066d7
No known key found for this signature in database GPG Key ID: E055D6A4D513575C
  1. 7
      src/components/LeftSidebar/ConversationsList/ConversationsList.vue

7
src/components/LeftSidebar/ConversationsList/ConversationsList.vue

@ -95,6 +95,13 @@ export default {
})
},
onRouteChange({ from, to }) {
if (from.name === 'conversation'
&& to.name === 'conversation'
&& from.token === to.token) {
// this is triggered when the hash in the URL changes
return
}
if (from.name === 'conversation') {
leaveConversation(from.params.token)
}

Loading…
Cancel
Save