lint
This commit is contained in:
parent
4ad176a68b
commit
9eee55df4a
2 changed files with 9 additions and 16 deletions
|
|
@ -35,9 +35,7 @@ const AnnouncementsPage = {
|
||||||
canPostAnnouncement() {
|
canPostAnnouncement() {
|
||||||
return (
|
return (
|
||||||
this.currentUser &&
|
this.currentUser &&
|
||||||
this.currentUser.privileges.has(
|
this.currentUser.privileges.has('announcements_manage_announcements')
|
||||||
'announcements_manage_announcements',
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -22,21 +22,16 @@ export const promiseInterval = (promiseCall, interval) => {
|
||||||
window.clearTimeout(timeout)
|
window.clearTimeout(timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
const loop = new Promise(async (resolve, reject) => {
|
const loop = async () => {
|
||||||
try {
|
while (!stopped) {
|
||||||
while (!stopped) {
|
await promiseCall()
|
||||||
await promiseCall()
|
const { timeoutId, promise } = wait(interval)
|
||||||
const { timeoutId, promise } = wait(interval)
|
timeout = timeoutId
|
||||||
timeout = timeoutId
|
await promise()
|
||||||
await promise()
|
|
||||||
}
|
|
||||||
resolve()
|
|
||||||
} catch (e) {
|
|
||||||
reject(e)
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
loop.then()
|
loop().then()
|
||||||
|
|
||||||
return { stop: stopFetcher }
|
return { stop: stopFetcher }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue