summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGrigorii K. Shartsev <me@shgk.me>2023-07-19 00:59:41 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-07-19 12:39:36 +0000
commit956244d34230927327848666d6a4b7c0b1085058 (patch)
tree308962249c9efe05bfe698abd29720e075ff52ad /src
parent3e9bdf929dffe864c776c2b051a22249e3bca1cd (diff)
refactor(conversations): remove unused purgeConversationsStore action
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
Diffstat (limited to 'src')
-rw-r--r--src/store/conversationsStore.js25
-rw-r--r--src/store/conversationsStore.spec.js14
2 files changed, 0 insertions, 39 deletions
diff --git a/src/store/conversationsStore.js b/src/store/conversationsStore.js
index 89a3a5e36..f3bc8b8a5 100644
--- a/src/store/conversationsStore.js
+++ b/src/store/conversationsStore.js
@@ -85,13 +85,6 @@ const DUMMY_CONVERSATION = {
isDummyConversation: true,
}
-const getDefaultState = () => {
- return {
- conversations: {
- },
- }
-}
-
const state = {
conversations: {
},
@@ -146,14 +139,6 @@ const mutations = {
deleteConversation(state, token) {
Vue.delete(state.conversations, token)
},
- /**
- * Resets the store to its original state
- *
- * @param {object} state current store state;
- */
- purgeConversationsStore(state) {
- Object.assign(state, getDefaultState())
- },
setConversationDescription(state, { token, description }) {
Vue.set(state.conversations[token], 'description', description)
@@ -377,16 +362,6 @@ const actions = {
}
},
- /**
- * Resets the store to its original state.
- *
- * @param {object} context default store context;
- */
- purgeConversationsStore(context) {
- // TODO: also purge messages ??
- context.commit('purgeConversationsStore')
- },
-
async toggleGuests({ commit, getters }, { token, allowGuests }) {
if (!getters.conversations[token]) {
return
diff --git a/src/store/conversationsStore.spec.js b/src/store/conversationsStore.spec.js
index 612628f4d..0ba2c6cb7 100644
--- a/src/store/conversationsStore.spec.js
+++ b/src/store/conversationsStore.spec.js
@@ -192,20 +192,6 @@ describe('conversationsStore', () => {
expect(deleteConversation).not.toHaveBeenCalled()
})
- test('purges all conversations', () => {
- const testConversation2 = Object.assign({}, testConversation, {
- token: 'XXANOTHERXX',
- })
- store.dispatch('addConversation', testConversation)
- store.dispatch('addConversation', testConversation2)
-
- store.dispatch('purgeConversationsStore')
-
- expect(store.getters.conversation(testToken)).toBeUndefined()
- expect(store.getters.conversation('XXANOTHERXX')).toBeUndefined()
- expect(store.getters.conversationsList).toStrictEqual([])
- })
-
test('deletes conversation from server', async () => {
store.dispatch('addConversation', testConversation)