#392: clean up notification stopping section
This commit is contained in:
parent
bbe1821be7
commit
f3f9fbe302
|
@ -401,6 +401,12 @@ const statuses = {
|
||||||
setNotificationsSilence ({ rootState, commit }, { value }) {
|
setNotificationsSilence ({ rootState, commit }, { value }) {
|
||||||
commit('setNotificationsSilence', { value })
|
commit('setNotificationsSilence', { value })
|
||||||
},
|
},
|
||||||
|
stopFetchingNotifications ({ rootState, commit }) {
|
||||||
|
if (rootState.statuses.notifications.fetcherId) {
|
||||||
|
window.clearInterval(rootState.statuses.notifications.fetcherId)
|
||||||
|
}
|
||||||
|
commit('setNotificationFetcher', { fetcherId: null })
|
||||||
|
},
|
||||||
deleteStatus ({ rootState, commit }, status) {
|
deleteStatus ({ rootState, commit }, status) {
|
||||||
commit('setDeleted', { status })
|
commit('setDeleted', { status })
|
||||||
apiService.deleteStatus({ id: status.id, credentials: rootState.users.currentUser.credentials })
|
apiService.deleteStatus({ id: status.id, credentials: rootState.users.currentUser.credentials })
|
||||||
|
|
|
@ -290,9 +290,7 @@ const users = {
|
||||||
store.commit('setToken', false)
|
store.commit('setToken', false)
|
||||||
store.dispatch('stopFetching', 'friends')
|
store.dispatch('stopFetching', 'friends')
|
||||||
store.commit('setBackendInteractor', backendInteractorService())
|
store.commit('setBackendInteractor', backendInteractorService())
|
||||||
if (store.rootState.statuses.notifications.fetcherId) {
|
store.dispatch('stopFetchingNotifications')
|
||||||
window.clearInterval(store.rootState.statuses.notifications.fetcherId)
|
|
||||||
}
|
|
||||||
store.commit('resetStatuses')
|
store.commit('resetStatuses')
|
||||||
},
|
},
|
||||||
loginUser (store, accessToken) {
|
loginUser (store, accessToken) {
|
||||||
|
|
Loading…
Reference in New Issue