From 7389f071151d271187b3236a4f56ebfdc018c289 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 7 Jun 2018 01:24:31 +0000 Subject: follow requests: refactor to properly leverage vuex --- src/modules/api.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/modules/api.js') diff --git a/src/modules/api.js b/src/modules/api.js index c91fb97b..a61340c2 100644 --- a/src/modules/api.js +++ b/src/modules/api.js @@ -7,7 +7,8 @@ const api = { backendInteractor: backendInteractorService(), fetchers: {}, socket: null, - chatDisabled: false + chatDisabled: false, + followRequests: [] }, mutations: { setBackendInteractor (state, backendInteractor) { @@ -24,6 +25,9 @@ const api = { }, setChatDisabled (state, value) { state.chatDisabled = value + }, + setFollowRequests (state, value) { + state.followRequests = value } }, actions: { @@ -57,6 +61,10 @@ const api = { }, disableChat (store) { store.commit('setChatDisabled', true) + }, + removeFollowRequest (store, request) { + let requests = store.state.followRequests.filter((it) => it !== request) + store.commit('setFollowRequests', requests) } } } -- cgit v1.2.3-70-g09d2