fix(desktop): skip deferred navigation for selected channel

Avoid replacing an already-selected channel with a navigation skeleton when its
sidebar item is clicked again.

Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
This commit is contained in:
Wes
2026-08-16 11:35:02 -06:00
co-authored by Carl
parent 7757f6d658
commit c6ea385186
@@ -77,6 +77,10 @@ export function useDeferredSidebarNavigation({
const selectDeferred = React.useCallback(
(channelId: string) => {
if (channelId === selectedChannelId) {
selectChannel(channelId);
return;
}
dispatchNavigationIntent();
cancel();
const generation = generationRef.current;
@@ -118,7 +122,7 @@ export function useDeferredSidebarNavigation({
});
});
},
[cancel, selectChannel],
[cancel, selectChannel, selectedChannelId],
);
return { pendingChannelId, selectDeferred };