summaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2021-06-14 13:10:42 +0200
committerGitHub <noreply@github.com>2021-06-14 13:10:42 +0200
commit8e1fcd473faf95d9a5bb8912a864aa930fed5474 (patch)
tree889fd6f0f48e0379cb3cfc6def6183a4cfecaedd /src/components
parent64a47f92d294d92c3f6564db769eca5c8458eea8 (diff)
parentd79b5ed73e9f70b90858e549610a313c7f2bfcc1 (diff)
Merge pull request #5736 from nextcloud/bugfix/5733/remove-concurrent-request-on-delete
Don't trigger leave event when deleting conversation
Diffstat (limited to 'src/components')
-rw-r--r--src/components/LeftSidebar/ConversationsList/Conversation.spec.js24
-rw-r--r--src/components/LeftSidebar/ConversationsList/Conversation.vue7
2 files changed, 0 insertions, 31 deletions
diff --git a/src/components/LeftSidebar/ConversationsList/Conversation.spec.js b/src/components/LeftSidebar/ConversationsList/Conversation.spec.js
index ac0b53062..0488f0388 100644
--- a/src/components/LeftSidebar/ConversationsList/Conversation.spec.js
+++ b/src/components/LeftSidebar/ConversationsList/Conversation.spec.js
@@ -475,30 +475,6 @@ describe('Conversation.vue', () => {
expect(updateTokenAction).not.toHaveBeenCalled()
})
- test('redirects when deleting current conversation', async() => {
- const actionHandler = jest.fn().mockResolvedValueOnce()
- const updateTokenAction = jest.fn()
- testStoreConfig.modules.conversationsStore.actions.deleteConversationFromServer = actionHandler
- testStoreConfig.modules.tokenStore.getters.getToken = jest.fn().mockReturnValue(() => TOKEN)
- testStoreConfig.modules.tokenStore.actions.updateToken = updateTokenAction
-
- OC.dialogs.confirm = jest.fn()
-
- const action = shallowMountAndGetAction('Delete conversation')
- expect(action.exists()).toBe(true)
-
- await action.find('button').trigger('click')
-
- expect(OC.dialogs.confirm).toHaveBeenCalled()
-
- // call callback directly
- OC.dialogs.confirm.mock.calls[0][2](true)
-
- expect(actionHandler).toHaveBeenCalledWith(expect.anything(), { token: TOKEN })
- expect($router.push).toHaveBeenCalled()
- expect(updateTokenAction).toHaveBeenCalledWith(expect.anything(), '')
- })
-
test('does not delete conversation when not confirmed', async() => {
const actionHandler = jest.fn().mockResolvedValueOnce()
const updateTokenAction = jest.fn()
diff --git a/src/components/LeftSidebar/ConversationsList/Conversation.vue b/src/components/LeftSidebar/ConversationsList/Conversation.vue
index f7256af6d..0ba879a5b 100644
--- a/src/components/LeftSidebar/ConversationsList/Conversation.vue
+++ b/src/components/LeftSidebar/ConversationsList/Conversation.vue
@@ -342,13 +342,6 @@ export default {
return
}
- // TODO: verify if this is already happening automatically after deletion,
- // just like when leaving a conversation
- if (this.item.token === this.$store.getters.getToken()) {
- this.$router.push({ name: 'root', params: { skipLeaveWarning: true } })
- this.$store.dispatch('updateToken', '')
- }
-
try {
await this.$store.dispatch('deleteConversationFromServer', { token: this.item.token })
} catch (error) {