fix(lastfm): use user-scoped storage for session restore on startup
bootstrap.ts used raw localStorage.getItem() while settings saved with user-scoped setUserItem(), causing session key mismatch. Closes #143
This commit is contained in:
1 file changed
+2
-1
@@ -13,6 +13,7 @@ import { loadSystemNotificationsPreference, flushScrobbleQueue } from '$lib/serv
|
|||||||
import { initOfflineStore, cleanupOfflineStore, onOnlineTransition, syncPendingPlaylists } from '$lib/stores/offlineStore';
|
import { initOfflineStore, cleanupOfflineStore, onOnlineTransition, syncPendingPlaylists } from '$lib/stores/offlineStore';
|
||||||
import { loadUnavailableTracks } from '$lib/stores/unavailableTracksStore';
|
import { loadUnavailableTracks } from '$lib/stores/unavailableTracksStore';
|
||||||
import { getNextZoomLevel } from '$lib/utils/zoom';
|
import { getNextZoomLevel } from '$lib/utils/zoom';
|
||||||
|
import { getUserItem } from '$lib/utils/userStorage';
|
||||||
import { getZoom, setZoom } from '$lib/stores/zoomStore';
|
import { getZoom, setZoom } from '$lib/stores/zoomStore';
|
||||||
import { restoreAutoThemeVars } from '$lib/stores/autoThemeStore';
|
import { restoreAutoThemeVars } from '$lib/stores/autoThemeStore';
|
||||||
|
|
||||||
@@ -87,7 +88,7 @@ export function setupZoomControls(): () => void {
|
|||||||
*/
|
*/
|
||||||
export async function restoreLastfmSession(): Promise<void> {
|
export async function restoreLastfmSession(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const savedSessionKey = localStorage.getItem('qbz-lastfm-session-key');
|
const savedSessionKey = getUserItem('qbz-lastfm-session-key');
|
||||||
|
|
||||||
// Restore session if available (proxy handles credentials)
|
// Restore session if available (proxy handles credentials)
|
||||||
if (savedSessionKey) {
|
if (savedSessionKey) {
|
||||||
|
|||||||
Reference in new issue
Block a user