aboutsummaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
authorShpuld Shpuldson <shp@cock.li>2020-09-02 21:01:31 +0300
committerShpuld Shpuldson <shp@cock.li>2020-09-02 21:01:31 +0300
commit1b6eee049700f6fbb0c2e43877ead3ef4cf3041b (patch)
treecf2d12e16c75c5fa3de1ab51a4120405f9fbe40f /src/services
parent2d914c331eea5f5b9036e10ef3d937628891b9e1 (diff)
change chats to use custom makeFetcher
Diffstat (limited to 'src/services')
-rw-r--r--src/services/fetcher/fetcher.js3
-rw-r--r--src/services/notifications_fetcher/notifications_fetcher.service.js2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/services/fetcher/fetcher.js b/src/services/fetcher/fetcher.js
index 1d9239cc..95b8c9d3 100644
--- a/src/services/fetcher/fetcher.js
+++ b/src/services/fetcher/fetcher.js
@@ -6,7 +6,6 @@ export const makeFetcher = (call, interval) => {
func = () => {
call().finally(() => {
- console.log('callbacks')
if (stopped) return
timeout = window.setTimeout(func, interval)
})
@@ -14,7 +13,7 @@ export const makeFetcher = (call, interval) => {
const stopFetcher = () => {
stopped = true
- window.cancelTimeout(timeout)
+ window.clearTimeout(timeout)
}
func()
diff --git a/src/services/notifications_fetcher/notifications_fetcher.service.js b/src/services/notifications_fetcher/notifications_fetcher.service.js
index 2a3a17be..c69d5b17 100644
--- a/src/services/notifications_fetcher/notifications_fetcher.service.js
+++ b/src/services/notifications_fetcher/notifications_fetcher.service.js
@@ -1,5 +1,5 @@
import apiService from '../api/api.service.js'
-import makeFetcher from '../fetcher/fetcher.js'
+import { makeFetcher } from '../fetcher/fetcher.js'
const update = ({ store, notifications, older }) => {
store.dispatch('setNotificationsError', { value: false })