fix: several small fixes
This commit is contained in:
@@ -25,18 +25,22 @@
|
||||
let { children } = $props();
|
||||
|
||||
onMount(async () => {
|
||||
// Initialize auth state (restore session from secure storage)
|
||||
await auth.initialize();
|
||||
isInitialized.set(true);
|
||||
|
||||
// Detect platform (Android needs global mini player)
|
||||
// Detect platform first (synchronously, before any await) so the global
|
||||
// mini player's Android visibility gate is correct from the first render.
|
||||
// Android needs the global mini player because the library layout hides its
|
||||
// own; if this ran after `await auth.initialize()` the store stayed false
|
||||
// long enough that the mini player never appeared on library routes.
|
||||
try {
|
||||
const platformName = await platform();
|
||||
const platformName = platform();
|
||||
isAndroid.set(platformName === "android");
|
||||
} catch (err) {
|
||||
console.error("Platform detection failed:", err);
|
||||
}
|
||||
|
||||
// Initialize auth state (restore session from secure storage)
|
||||
await auth.initialize();
|
||||
isInitialized.set(true);
|
||||
|
||||
// Initialize player event listener for push-based updates
|
||||
await initPlayerEvents();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user