feat: channel deletion UI with full backend cleanup

Add Delete Channel button to channel settings modal with ConfirmDialog
confirmation. Fix backend DELETE route to disconnect voice users, clean
up attachment files from disk, and remove orphaned read_states. Make
deleteChannel federation-aware in spaceStore and clean up voiceUsers
on channel_deleted WebSocket event.
This commit is contained in:
Jannis Braun
2026-03-12 02:44:42 +01:00
parent 5193d79c39
commit 88ca2d532b
4 changed files with 171 additions and 61 deletions
+9
View File
@@ -624,6 +624,15 @@ function handleEvent(origin: string, event: ServerEvent): void {
useChatStore.setState({ unreadChannels: newUnread, readStates: newRS });
}
}
// Clean up voice users for the deleted channel
{
const vs = useVoiceStore.getState();
if (vs.voiceUsers.has(event.channelId)) {
const newVoiceUsers = new Map(vs.voiceUsers);
newVoiceUsers.delete(event.channelId);
useVoiceStore.setState({ voiceUsers: newVoiceUsers });
}
}
{
const { currentChannelId } = useChatStore.getState();
if (currentChannelId === event.channelId) {