fix chat fetcher stops, change fetcher code

This commit is contained in:
Shpuld Shpuldson 2020-09-04 11:22:14 +03:00
parent 3fb35e8123
commit c89ac79140
2 changed files with 3 additions and 4 deletions

View file

@ -8,9 +8,8 @@
export const promiseInterval = (promiseCall, interval) => {
let stopped = false
let timeout = null
let func = () => {}
func = () => {
const func = () => {
promiseCall().finally(() => {
if (stopped) return
timeout = window.setTimeout(func, interval)