mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-15 00:50:45 +08:00
feat: support per-bot workspace switching
This commit is contained in:
parent
adcace3512
commit
44dd50216a
64 changed files with 3878 additions and 712 deletions
|
|
@ -311,7 +311,14 @@ export class WhatsappController {
|
|||
if (record.controller.signal.aborted || this.#closed || error?.name === 'AbortError') {
|
||||
await this.#stopRuntime(botId);
|
||||
if (previous) await this.#configStore.save(previous).catch(() => undefined);
|
||||
else await this.#configStore.remove(botId).catch(() => undefined);
|
||||
else {
|
||||
const removed = await this.#configStore.remove(botId).catch(() => null);
|
||||
if (removed) {
|
||||
await this.#deleteState({ botId, config }).catch((cleanupError) => {
|
||||
this.#logger.warn?.('[dsh-im:whatsapp] cancelled bot state cleanup failed:', cleanupError);
|
||||
});
|
||||
}
|
||||
}
|
||||
await this.#deleteAuth(record.authDirectory).catch(() => undefined);
|
||||
if (previous) await this.#startRuntime(previous).catch(() => undefined);
|
||||
record.state = 'cancelled';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue