forked from Blendman974/faceclaw
Fix issue where you could want up without the official Even font extracted, if you skipped onboarding
This commit is contained in:
1 parent
54005ae95a
commit
8a86cf28e1
6 files changed
+134
-8
No files matched your search
@@ -84,6 +84,10 @@
|
||||
<Label text="Android will slow Faceclaw to a crawl when the phone screen is off unless it is exempt from battery optimization." textWrap="true" />
|
||||
<Button text="Allow unrestricted background usage" tap="{{ onAllowBackgroundUsageTap }}" class="-primary" />
|
||||
</StackLayout>
|
||||
<StackLayout visibility="{{ fontsMissingWarningVisibility }}" class="warnings-modal-item">
|
||||
<Label text="The G2 fonts have not been extracted, so EvenHub apps will render with fallback fonts. Preparing them downloads the official firmware to extract its fonts; your glasses are not reflashed." textWrap="true" />
|
||||
<Button text="Prepare G2 fonts" tap="{{ onPrepareFontsTap }}" class="-primary" />
|
||||
</StackLayout>
|
||||
<Button text="Close" tap="{{ onWarningsModalCloseTap }}" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
|
||||
@@ -60,6 +60,7 @@ export class MainViewModel extends Observable {
|
||||
private _firmwareWarningVisible = false;
|
||||
private _screenRecordingActive = false;
|
||||
private _batteryOptimizationWarningVisible = false;
|
||||
private _fontsMissingWarningVisible = false;
|
||||
private _warningsModalVisible = false;
|
||||
private _previewMode = false;
|
||||
private _phase: "disconnected" | "connecting" | "connected" | "charging" | "disconnecting" = "disconnected";
|
||||
@@ -106,6 +107,7 @@ export class MainViewModel extends Observable {
|
||||
this.firmwareWarningVisible = snapshot.firmwareWarningVisible;
|
||||
this.screenRecordingActive = snapshot.screenRecordingActive;
|
||||
this.batteryOptimizationWarningVisible = snapshot.batteryOptimizationWarningVisible;
|
||||
this.fontsMissingWarningVisible = snapshot.fontsMissingWarningVisible;
|
||||
this.refreshPadFocusLine();
|
||||
}));
|
||||
// Brightness / display mode can change from the glasses' Settings app too.
|
||||
@@ -570,6 +572,43 @@ export class MainViewModel extends Observable {
|
||||
return this._batteryOptimizationWarningVisible ? "visible" : "collapse";
|
||||
}
|
||||
|
||||
get fontsMissingWarningVisible(): boolean {
|
||||
return this._fontsMissingWarningVisible;
|
||||
}
|
||||
|
||||
set fontsMissingWarningVisible(value: boolean) {
|
||||
if (this._fontsMissingWarningVisible !== value) {
|
||||
this._fontsMissingWarningVisible = value;
|
||||
this.notifyPropertyChange("fontsMissingWarningVisible", value);
|
||||
this.notifyPropertyChange("fontsMissingWarningVisibility", this.fontsMissingWarningVisibility);
|
||||
this.refreshWarningIndicator();
|
||||
}
|
||||
}
|
||||
|
||||
get fontsMissingWarningVisibility(): "visible" | "collapse" {
|
||||
return this._fontsMissingWarningVisible ? "visible" : "collapse";
|
||||
}
|
||||
|
||||
/**
|
||||
* Jump back into the onboarding firmware check, whose missing-fonts path
|
||||
* downloads the stock firmware and extracts the G2 fonts without reflashing.
|
||||
* The check probes the glasses itself, so drop the main connection first;
|
||||
* like pairing, this is a detour rather than a Disconnect, so lift the
|
||||
* auto-reconnect suppression right away.
|
||||
*/
|
||||
async onPrepareFontsTap(): Promise<void> {
|
||||
this.setWarningsModalVisible(false);
|
||||
if (this.phase === "connected" || this.phase === "charging" || this.phase === "connecting") {
|
||||
try {
|
||||
await dashboardController.disconnect();
|
||||
} catch {
|
||||
// proceed anyway; the firmware check reports its own connection trouble
|
||||
}
|
||||
resumeAutoReconnect();
|
||||
}
|
||||
Frame.topmost()?.navigate({ moduleName: "phone-ui/onboarding-firmware-check-page" });
|
||||
}
|
||||
|
||||
onAllowBackgroundUsageTap(): void {
|
||||
this.setWarningsModalVisible(false);
|
||||
dashboardController.requestBatteryOptimizationExemption();
|
||||
@@ -581,7 +620,8 @@ export class MainViewModel extends Observable {
|
||||
return (
|
||||
this._evenAppConflictWarningVisible ||
|
||||
this._firmwareWarningVisible ||
|
||||
this._batteryOptimizationWarningVisible
|
||||
this._batteryOptimizationWarningVisible ||
|
||||
this._fontsMissingWarningVisible
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user