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 () => { return this.queue.add(async () => {
this.active = false if (!this.active) return
// TODO: disable message components // 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() {
return this.queue.add(async () => {
this.active = false this.active = false
await this.message?.delete() return this.queue.add(async () => {
const message = this.message
this.message = undefined
await message?.delete()
}) })
} }
} }