From e752791d3a5566b0640dedb87f7fe037e9657b0b Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Sun, 18 Jan 2026 16:17:30 -0600 Subject: [PATCH] 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 --- src/lib/components/views/FavoritesView.svelte | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/lib/components/views/FavoritesView.svelte b/src/lib/components/views/FavoritesView.svelte index 891831c45..2ec39b021 100644 --- a/src/lib/components/views/FavoritesView.svelte +++ b/src/lib/components/views/FavoritesView.svelte @@ -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() {