aboutsummaryrefslogtreecommitdiff
path: root/src/modules/api.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/api.js')
-rw-r--r--src/modules/api.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/modules/api.js b/src/modules/api.js
index c91fb97b..2f07a91e 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: {
@@ -42,6 +46,9 @@ const api = {
store.commit('addFetcher', {timeline, fetcher})
}
},
+ fetchOldPost (store, { postId }) {
+ store.state.backendInteractor.fetchOldPost({ store, postId })
+ },
stopFetching (store, timeline) {
const fetcher = store.state.fetchers[timeline]
window.clearInterval(fetcher)
@@ -57,6 +64,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)
}
}
}