diff options
| author | dave <starpumadev@gmail.com> | 2019-03-01 11:59:50 -0500 |
|---|---|---|
| committer | dave <starpumadev@gmail.com> | 2019-03-01 11:59:50 -0500 |
| commit | f3f9fbe3027bf5284adc05387e89d904884490b2 (patch) | |
| tree | f76f91a0ed640dfc502e6da5e8e84beef9c0defc /src | |
| parent | bbe1821be7c098f3a23bd0dd54b4ec89a159e9c1 (diff) | |
#392: clean up notification stopping section
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/statuses.js | 6 | ||||
| -rw-r--r-- | src/modules/users.js | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 028053cf..77a8ec72 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -401,6 +401,12 @@ const statuses = { setNotificationsSilence ({ rootState, commit }, { 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) { commit('setDeleted', { status }) apiService.deleteStatus({ id: status.id, credentials: rootState.users.currentUser.credentials }) diff --git a/src/modules/users.js b/src/modules/users.js index 84fe039b..0e1dd166 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -290,9 +290,7 @@ const users = { store.commit('setToken', false) store.dispatch('stopFetching', 'friends') store.commit('setBackendInteractor', backendInteractorService()) - if (store.rootState.statuses.notifications.fetcherId) { - window.clearInterval(store.rootState.statuses.notifications.fetcherId) - } + store.dispatch('stopFetchingNotifications') store.commit('resetStatuses') }, loginUser (store, accessToken) { |
