From 7d59051fc5e93585d8d9858ac989d9ebf7aa3cf9 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 2 Jul 2017 12:25:34 +0200 Subject: Add logout button. --- src/modules/users.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/modules') 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 -- cgit v1.2.3-70-g09d2 From 701112f043720c294241852f9aa0a0f1956cd71c Mon Sep 17 00:00:00 2001 From: eal Date: Thu, 10 Aug 2017 19:17:40 +0300 Subject: Add follow notifications. --- src/components/notifications/notifications.scss | 4 ++++ src/components/notifications/notifications.vue | 9 +++++++++ src/modules/statuses.js | 7 +++++++ 3 files changed, 20 insertions(+) (limited to 'src/modules') diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index f02ced8d..84dd36fa 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -49,6 +49,10 @@ color: $green; } + .icon-user-plus.lit { + color: $blue; + } + .icon-reply.lit { color: $blue; } diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index 6c0419a5..c9113bc4 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -36,6 +36,15 @@ +
+

+ {{ notification.action.user.name }} + +

+
+ @{{ notification.action.user.screen_name }} followed you +
+
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) -- cgit v1.2.3-70-g09d2