fix back button size, fix missing chat notifications being marked as read too eagerly, fix promiseinterval erroring when not getting a promise
This commit is contained in:
parent
e2c4816feb
commit
2c441c7922
4 changed files with 25 additions and 11 deletions
|
@ -10,7 +10,14 @@ export const promiseInterval = (promiseCall, interval) => {
|
|||
let timeout = null
|
||||
|
||||
const func = () => {
|
||||
promiseCall().finally(() => {
|
||||
const promise = promiseCall()
|
||||
// something unexpected happened and promiseCall did not
|
||||
// return a promise, abort the loop.
|
||||
if (!(promise && promise.finally)) {
|
||||
console.warn('promiseInterval: promise call did not return a promise, stopping interval.')
|
||||
return
|
||||
}
|
||||
promise.finally(() => {
|
||||
if (stopped) return
|
||||
timeout = window.setTimeout(func, interval)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue