fix: migrate localStorage to user-scoped storage in views
ArtistDetailView sort preferences and PlaylistDetailView copied playlists now use getUserItem/setUserItem for per-user scoping. Added migrateLocalStorageV2 to handle qbz_ prefixed keys that the original migration missed (only covered qbz- prefix). Runs once per user independently from v1 migration.
This commit is contained in:
4 files changed
+56
-13
No files matched your search
@@ -130,7 +130,7 @@
|
||||
getAuthState,
|
||||
type UserInfo
|
||||
} from '$lib/stores/authStore';
|
||||
import { setStorageUserId, migrateLocalStorage, getUserItem, setUserItem } from '$lib/utils/userStorage';
|
||||
import { setStorageUserId, migrateLocalStorage, migrateLocalStorageV2, getUserItem, setUserItem } from '$lib/utils/userStorage';
|
||||
|
||||
// Favorites state management
|
||||
import { loadFavorites } from '$lib/stores/favoritesStore';
|
||||
@@ -2750,6 +2750,7 @@
|
||||
// Set up per-user localStorage scoping and migrate old keys
|
||||
setStorageUserId(info.userId);
|
||||
migrateLocalStorage(info.userId);
|
||||
migrateLocalStorageV2(info.userId);
|
||||
|
||||
// Re-read stores that were initialised at module-load (before userId was set)
|
||||
rehydratePurchasesStore();
|
||||
|
||||
Reference in new issue
Block a user