diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-05-02 11:51:39 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-05-02 16:21:46 +0300 |
| commit | b095d2e17e03189adb62227da95ca5431bc64f5a (patch) | |
| tree | b9f35e9f215256b2efd43bdd199bbd5916c0257a | |
| parent | 20b53d58b753075bb1bda49d0595eba02ed5f755 (diff) | |
don't dismiss a rejected follow request on server
| -rw-r--r-- | src/components/follow_request_card/follow_request_card.js | 9 | ||||
| -rw-r--r-- | src/components/notification/notification.js | 6 | ||||
| -rw-r--r-- | src/modules/statuses.js | 5 |
3 files changed, 13 insertions, 7 deletions
diff --git a/src/components/follow_request_card/follow_request_card.js b/src/components/follow_request_card/follow_request_card.js index 33e2699e..cbd75311 100644 --- a/src/components/follow_request_card/follow_request_card.js +++ b/src/components/follow_request_card/follow_request_card.js @@ -27,11 +27,12 @@ const FollowRequestCard = { }) }, denyUser () { - this.$store.state.api.backendInteractor.denyUser({ id: this.user.id }) - this.$store.dispatch('removeFollowRequest', this.user) - const notifId = this.findFollowRequestNotificationId() - this.$store.dispatch('dismissNotification', { id: notifId }) + this.$store.state.api.backendInteractor.denyUser({ id: this.user.id }) + .then(() => { + this.$store.dispatch('dismissNotificationLocal', { id: notifId }) + this.$store.dispatch('removeFollowRequest', this.user) + }) } } } diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index abe3bebe..1ae81ce4 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -47,8 +47,10 @@ const Notification = { }, denyUser () { this.$store.state.api.backendInteractor.denyUser({ id: this.user.id }) - this.$store.dispatch('removeFollowRequest', this.user) - this.$store.dispatch('dismissNotification', { id: this.notification.id }) + .then(() => { + this.$store.dispatch('dismissNotificationLocal', { id: this.notification.id }) + this.$store.dispatch('removeFollowRequest', this.user) + }) } }, computed: { diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 2a8b9581..cd8c1dba 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -703,9 +703,12 @@ const statuses = { credentials: rootState.users.currentUser.credentials }) }, + dismissNotificationLocal ({ rootState, commit }, { id }) { + commit('dismissNotification', { id }) + }, dismissNotification ({ rootState, commit }, { id }) { + commit('dismissNotification', { id }) rootState.api.backendInteractor.dismissNotification({ id }) - .then(() => commit('dismissNotification', { id })) }, updateNotification ({ rootState, commit }, { id, updater }) { commit('updateNotification', { id, updater }) |
