fix(favorites): restore tab navigation functionality
Removed continuous sync that was overriding user tab clicks. Now only syncs activeTab with currentTab on initial mount to respect configured first tab, then allows normal tab navigation. cp
This commit is contained in:
1 parent
ffb16656e7
commit
4a6f09d5b9
1 file changed
+9
-8
@@ -128,13 +128,7 @@
|
|||||||
|
|
||||||
type TabType = 'tracks' | 'albums' | 'artists' | 'playlists';
|
type TabType = 'tracks' | 'albums' | 'artists' | 'playlists';
|
||||||
let activeTab = $state<TabType>('tracks');
|
let activeTab = $state<TabType>('tracks');
|
||||||
|
let isInitialMount = $state(true);
|
||||||
// Sync activeTab with navigation store when parent passes currentTab
|
|
||||||
$effect(() => {
|
|
||||||
if (currentTab && currentTab !== activeTab) {
|
|
||||||
activeTab = currentTab;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const tabLabels: Record<TabType, string> = {
|
const tabLabels: Record<TabType, string> = {
|
||||||
tracks: 'Tracks',
|
tracks: 'Tracks',
|
||||||
@@ -312,8 +306,15 @@
|
|||||||
albumGroupingEnabled = loadStoredBool('qbz-favorites-album-group-enabled', false);
|
albumGroupingEnabled = loadStoredBool('qbz-favorites-album-group-enabled', false);
|
||||||
trackGroupingEnabled = loadStoredBool('qbz-favorites-track-group-enabled', false);
|
trackGroupingEnabled = loadStoredBool('qbz-favorites-track-group-enabled', false);
|
||||||
artistGroupingEnabled = loadStoredBool('qbz-favorites-artist-group-enabled', false);
|
artistGroupingEnabled = loadStoredBool('qbz-favorites-artist-group-enabled', false);
|
||||||
loadFavorites('tracks');
|
|
||||||
loadFavoritesPreferences();
|
loadFavoritesPreferences();
|
||||||
|
|
||||||
|
// On initial mount, sync with navigation store to load configured first tab
|
||||||
|
if (isInitialMount && currentTab) {
|
||||||
|
activeTab = currentTab;
|
||||||
|
isInitialMount = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
loadFavorites(activeTab);
|
||||||
});
|
});
|
||||||
|
|
||||||
async function loadFavoritesPreferences() {
|
async function loadFavoritesPreferences() {
|
||||||
|
|||||||
Reference in new issue
Block a user