Take a deleted bot out of the rail at once

Deleting a bot only changed the page after a reload. The delete route now
reads who could see the bot before removing it, since its assignments and
workspace places go with it, then pushes server:bot-removed
(BotRemovedData) to them. useLiveBots drops the row, so every tab and
every workspace the bot was in updates together.
This commit is contained in:
2026-10-19 12:20:38 +01:00
parent fccaa6e280
commit 731ea73486
5 changed files with 62 additions and 2 deletions
+11
View File
@@ -134,6 +134,13 @@ export type BotCreatedData = {
in_own_chat: boolean;
};
/**
* `server:bot-removed` data: the bot that was deleted.
*/
export type BotRemovedData = {
bot_id: number;
};
/**
* `server:bot-updated` data: the bot's new face and status line, and its
* active task (null when there is none).
@@ -550,6 +557,10 @@ export const WebSocketEvents = [
* `BotCreatedData`)
*/
"server:bot-created",
/**
* A bot the user could see was deleted (`data`: `BotRemovedData`)
*/
"server:bot-removed",
/**
* A bot's face or status line changed (`data`: `BotUpdatedData`)
*/