Autoconnect on reaching main screen; play sound effect on first launch

This commit is contained in:
James Babcock committed 2026-07-10 23:24:17 -07:00
1 parent ea80d05607
commit d97429a21a
5 files changed
+91

No files matched your search

+19
View File
@@ -2,13 +2,32 @@ import { ApplicationSettings } from "@nativescript/core";
const ONBOARDING_COMPLETE_KEY = "onboarding.complete";
const PREVIEW_ONLY_KEY = "onboarding.previewOnly";
const WELCOME_SOUND_PENDING_KEY = "onboarding.welcomeSoundPending";
export function hasCompletedOnboarding(): boolean {
return ApplicationSettings.getBoolean(ONBOARDING_COMPLETE_KEY, false);
}
export function setOnboardingCompleted(completed: boolean): void {
const wasCompleted = hasCompletedOnboarding();
ApplicationSettings.setBoolean(ONBOARDING_COMPLETE_KEY, completed);
// Arm the one-time welcome sound on the first-ever completion (not on the
// idempotent re-completions that happen when installing from the main menu).
if (completed && !wasCompleted) {
setWelcomeSoundPending(true);
}
}
/**
* True when onboarding just completed and the celebratory sound hasn't played
* yet. Consumed (and cleared) on the first successful glasses connection.
*/
export function isWelcomeSoundPending(): boolean {
return ApplicationSettings.getBoolean(WELCOME_SOUND_PENDING_KEY, false);
}
export function setWelcomeSoundPending(pending: boolean): void {
ApplicationSettings.setBoolean(WELCOME_SOUND_PENDING_KEY, pending);
}
/**