fix: correct async loading of favorites preferences and tab order

- Remove await from onMount (not async)
- Use .then() chain for proper async handling
- Initialize activeTab from preferences on mount
- Fixes tab order not persisting
- Fixes custom icon not displaying

cx
This commit is contained in:
vicrodh committed 2026-01-18 16:17:30 -06:00
1 parent 5e60de9970
commit e752791d3a
1 file changed
+13 -9
+13 -9
View File
@@ -306,15 +306,19 @@
albumGroupingEnabled = loadStoredBool('qbz-favorites-album-group-enabled', false);
trackGroupingEnabled = loadStoredBool('qbz-favorites-track-group-enabled', false);
artistGroupingEnabled = loadStoredBool('qbz-favorites-artist-group-enabled', false);
await loadFavoritesPreferences();
// On initial mount, sync with navigation store to load configured first tab
if (isInitialMount && currentTab) {
activeTab = currentTab;
isInitialMount = false;
}
loadFavorites(activeTab);
loadFavoritesPreferences().then(() => {
// On initial mount, sync with navigation store to load configured first tab
if (isInitialMount && currentTab) {
activeTab = currentTab;
isInitialMount = false;
} else if (isInitialMount) {
// Load first tab from preferences
activeTab = favoritesPreferences.tab_order[0] as TabType;
isInitialMount = false;
}
loadFavorites(activeTab);
});
});
async function loadFavoritesPreferences() {