forked from Blendman974/faceclaw
Add choose-your-devices page to start of the onboarding flow
This commit is contained in:
1 parent
b353483ac2
commit
41ef3b88a0
12 files changed
+589
-102
No files matched your search
@@ -1,7 +1,13 @@
|
||||
import { ApplicationSettings } from "@nativescript/core";
|
||||
|
||||
import { getBooleanSetting, setBooleanSetting } from "../native/settings-store";
|
||||
|
||||
const ONBOARDING_COMPLETE_KEY = "onboarding.complete";
|
||||
const PREVIEW_ONLY_KEY = "onboarding.previewOnly";
|
||||
// The "onboarding." prefix keeps these on this phone in config transfers and
|
||||
// lets scripts/resetOnboarding.sh clear them.
|
||||
const OWNS_RING_KEY = "onboarding.ownsRing";
|
||||
const OWNS_WATCH_KEY = "onboarding.ownsWatch";
|
||||
|
||||
export function hasCompletedOnboarding(): boolean {
|
||||
return ApplicationSettings.getBoolean(ONBOARDING_COMPLETE_KEY, false);
|
||||
@@ -27,3 +33,24 @@ export function isPreviewOnlyMode(): boolean {
|
||||
export function setPreviewOnlyMode(previewOnly: boolean): void {
|
||||
ApplicationSettings.setBoolean(PREVIEW_ONLY_KEY, previewOnly);
|
||||
}
|
||||
|
||||
/**
|
||||
* Accessories chosen on the Your Devices onboarding page, for tailoring the
|
||||
* rest of setup. The glasses chosen there go in glassesTypeSetting instead.
|
||||
*/
|
||||
export function ownsRing(): boolean {
|
||||
return getBooleanSetting(OWNS_RING_KEY, false);
|
||||
}
|
||||
|
||||
export function setOwnsRing(owns: boolean): void {
|
||||
setBooleanSetting(OWNS_RING_KEY, owns);
|
||||
}
|
||||
|
||||
/** An Apple Watch on iOS, a Wear OS watch on Android. */
|
||||
export function ownsWatch(): boolean {
|
||||
return getBooleanSetting(OWNS_WATCH_KEY, false);
|
||||
}
|
||||
|
||||
export function setOwnsWatch(owns: boolean): void {
|
||||
setBooleanSetting(OWNS_WATCH_KEY, owns);
|
||||
}
|
||||
Reference in new issue
Block a user