This commit is contained in:
Henry Jameson 2026-06-16 18:45:58 +03:00
commit 9eee55df4a
2 changed files with 9 additions and 16 deletions

View file

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

View file

@ -22,21 +22,16 @@ export const promiseInterval = (promiseCall, interval) => {
window.clearTimeout(timeout)
}
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)
const loop = async () => {
while (!stopped) {
await promiseCall()
const { timeoutId, promise } = wait(interval)
timeout = timeoutId
await promise()
}
})
}
loop.then()
loop().then()
return { stop: stopFetcher }
}