Merge branch 'api-refactor' into shigusegubu-themes3
This commit is contained in:
commit
ec7a0c2e02
2 changed files with 9 additions and 16 deletions
|
|
@ -35,9 +35,7 @@ const AnnouncementsPage = {
|
|||
canPostAnnouncement() {
|
||||
return (
|
||||
this.currentUser &&
|
||||
this.currentUser.privileges.has(
|
||||
'announcements_manage_announcements',
|
||||
)
|
||||
this.currentUser.privileges.has('announcements_manage_announcements')
|
||||
)
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue