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:
@@ -318,7 +318,9 @@ export const useSpaceStore = create<SpaceState>((set, get) => ({
|
||||
},
|
||||
|
||||
deleteChannel: async (channelId: string) => {
|
||||
await api.channels.delete(channelId);
|
||||
const origin = get().channelOriginMap.get(channelId) ?? '';
|
||||
const channelApi = getApiForOrigin(origin);
|
||||
await channelApi.channels.delete(channelId);
|
||||
set((state) => ({
|
||||
channels: state.channels.filter(c => c.id !== channelId),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user