Compare commits

..

No commits in common. "ec7a0c2e027d96e9d718614a4031375717129c35" and "2e47ce09426852094e3ea63ae1234f0bd0d11067" have entirely different histories.

2 changed files with 16 additions and 9 deletions

View file

@ -35,7 +35,9 @@ const AnnouncementsPage = {
canPostAnnouncement() {
return (
this.currentUser &&
this.currentUser.privileges.has('announcements_manage_announcements')
this.currentUser.privileges.has(
'announcements_manage_announcements',
)
)
},
},

View file

@ -22,16 +22,21 @@ export const promiseInterval = (promiseCall, interval) => {
window.clearTimeout(timeout)
}
const loop = async () => {
while (!stopped) {
await promiseCall()
const { timeoutId, promise } = wait(interval)
timeout = timeoutId
await promise()
const loop = new Promise(async (resolve, reject) => {
try {
while (!stopped) {
await promiseCall()
const { timeoutId, promise } = wait(interval)
timeout = timeoutId
await promise()
}
resolve()
} catch (e) {
reject(e)
}
}
})
loop().then()
loop.then()
return { stop: stopFetcher }
}