diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/statuses.js | 7 | ||||
| -rw-r--r-- | src/modules/users.js | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 084800fa..de5d7d23 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -105,6 +105,10 @@ export const statusType = (status) => { return 'deletion' } + if (status.text.match(/started following/)) { + return 'follow' + } + return 'unknown' } @@ -253,6 +257,9 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us favoriteStatus(favorite) } }, + 'follow': (status) => { + addNotification({ type: 'follow', status: status, action: status }) + }, 'deletion': (deletion) => { const uri = deletion.uri updateMaxId(deletion) diff --git a/src/modules/users.js b/src/modules/users.js index b68f67e6..98ac8f7e 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -26,6 +26,9 @@ export const mutations = { setCurrentUser (state, user) { state.currentUser = merge(state.currentUser || {}, user) }, + clearCurrentUser (state) { + state.currentUser = false + }, beginLogin (state) { state.loggingIn = true }, @@ -66,6 +69,11 @@ const users = { store.commit('setUserForStatus', status) }) }, + logout (store) { + store.commit('clearCurrentUser') + store.dispatch('stopFetching', 'friends') + store.commit('setBackendInteractor', backendInteractorService()) + }, loginUser (store, userCredentials) { return new Promise((resolve, reject) => { const commit = store.commit |
