fix conflicts between rapid navigation and bookmarks (#440)

This commit is contained in:
Jake 2025-10-04 06:46:51 +01:00 • committed by GitHub
parent 197ae4b0d6
commit 2f05e75a85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -104,14 +104,7 @@ export default definePlugin({
return;
}
// Check if we're in bookmark viewing mode
const wasViewingViaBookmark = ChannelTabsUtils.isViewingViaBookmarkMode();
// Clear bookmark viewing mode when ANY navigation occurs
// This allows subsequent channel switches to work normally
if (wasViewingViaBookmark) {
ChannelTabsUtils.clearBookmarkViewingMode();
}
const isViewingViaBookmark = ChannelTabsUtils.isViewingViaBookmarkMode();
let { channelId } = data;
let { guildId } = data;
@ -147,6 +140,16 @@ export default definePlugin({
}
}
// if bookmark independent mode setting is on, navigate
if (isViewingViaBookmark) {
// dont modify tabs, just let that bookmark action happen
return;
}
// clear bookmark viewing mode only when this is NOT a bookmark navigation
// this happens when someone manually navigates to a channel (channel list)
ChannelTabsUtils.clearBookmarkViewingMode();
// At this point, channelId is guaranteed to be non-null
if (channelId && guildId) {
handleChannelSwitch({ guildId, channelId });