slight logical corrections in renderer

This commit is contained in:
itsMapleLeaf
2022-08-05 09:06:47 -05:00
parent e38a4439c1
commit 339bf5a24f

View File

@@ -50,17 +50,25 @@ export class ChannelMessageRenderer implements Renderer {
})
}
async deactivate() {
deactivate() {
return this.queue.add(async () => {
this.active = false
if (!this.active) return
// TODO: disable message components
// set active to false *after* running deactivation,
// so that other queued operations run first,
// and we can show the correct deactivated state
this.active = false
})
}
async destroy() {
destroy() {
this.active = false
return this.queue.add(async () => {
this.active = false
await this.message?.delete()
const message = this.message
this.message = undefined
await message?.delete()
})
}
}