Skip to content

Commit

Permalink
fix: draftMessage - resetState
Browse files Browse the repository at this point in the history
  • Loading branch information
juliahermak committed Jan 11, 2024
1 parent 0d322f1 commit 6b9c644
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ const store = {
},
logout({ dispatch }) {
dispatch('reset')
dispatch('draftMessage/resetState', null, { root: true })
},
unlock({ state, dispatch }) {
// user updated an app, F5 or something
Expand Down
4 changes: 4 additions & 0 deletions src/store/modules/draft-message/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ const getters: GetterTree<DraftState, RootState> = {
}

const actions: ActionTree<DraftState, RootState> = {
resetState(context) {
context.commit('reset')
},

deleteDraft(context, payload: { partnerId: string }) {
context.commit('deleteReplyTold', payload)
context.commit('deleteMessage', payload)
Expand Down

0 comments on commit 6b9c644

Please sign in to comment.