refactor: remove dead ConfirmDialog copy from space view branch

The leave-group-DM ConfirmDialog in the space/channel sidebar return
path was unreachable — group DMs only render in the DM view branch,
so setLeaveGroupDmId is never called from the space view.
This commit is contained in:
Jannis Braun
2026-03-27 04:01:50 +01:00
parent 6a4dd46729
commit c9c0acf2c4
@@ -886,31 +886,6 @@ export function ChannelSidebar() {
</div>
{floatingPanel}
<ConfirmDialog
isOpen={leaveGroupDmId !== null}
onClose={() => setLeaveGroupDmId(null)}
onConfirm={async () => {
if (!leaveGroupDmId) return;
setLeaveGroupDmLoading(true);
try {
if (currentChannelId === leaveGroupDmId) {
navigate('/channels/@me');
setCurrentChannel(null);
}
await useSpaceStore.getState().leaveDm(leaveGroupDmId);
setLeaveGroupDmId(null);
} catch {
// leaveDm already handles errors
} finally {
setLeaveGroupDmLoading(false);
}
}}
title="Leave Group DM"
description="Are you sure you want to leave? You won't be able to rejoin unless someone adds you back."
confirmLabel="Leave"
variant="danger"
loading={leaveGroupDmLoading}
/>
<ConfirmDialog
isOpen={deleteCategoryId !== null}
onClose={() => setDeleteCategoryId(null)}