mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
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:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user