forked from Blendman974/faceclaw
Merge commit 'refs/pull/20/head' of https://github.com/jimrandomh/faceclaw into dev
This commit is contained in:
commit
774c534c79
1 file changed
+12
-4
@@ -7,7 +7,7 @@ import {
|
|||||||
hasExtractedEvenHubFonts,
|
hasExtractedEvenHubFonts,
|
||||||
type FirmwareProgress,
|
type FirmwareProgress,
|
||||||
} from "../g2/firmware-builder";
|
} from "../g2/firmware-builder";
|
||||||
import { classifyOnboardingFirmware, FLASHABLE_STOCK_VERSION_TEXT } from "../g2/firmware-compat";
|
import { classifyOnboardingFirmware, FLASHABLE_STOCK_VERSION_TEXT, type OnboardingFirmwareKind } from "../g2/firmware-compat";
|
||||||
import { DeviceInfoProbe, DeviceInfoState } from "../native/device-info-probe";
|
import { DeviceInfoProbe, DeviceInfoState } from "../native/device-info-probe";
|
||||||
import { setOnboardingCompleted, setPreviewOnlyMode } from "./onboarding-state";
|
import { setOnboardingCompleted, setPreviewOnlyMode } from "./onboarding-state";
|
||||||
import { formatErrorMessage } from "../util/format-error";
|
import { formatErrorMessage } from "../util/format-error";
|
||||||
@@ -193,8 +193,16 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private applyClassification(kind: string, version: string, capabilities: string): void {
|
private applyClassification(kind: OnboardingFirmwareKind, version: string, capabilities: string): void {
|
||||||
this.busy = false;
|
this.busy = false;
|
||||||
|
// `kind` is classifyOnboardingFirmware's OnboardingFirmwareKind ("custom" |
|
||||||
|
// "flashable-stock" | "newer-stock" | "unknown") -- NOT CheckPhase's shorter
|
||||||
|
// "flashable"/"newer" (used below via setPhase for _phase/primaryLabel/etc).
|
||||||
|
// The two types share two of four names, so a typo'd case label here type-checks
|
||||||
|
// fine as long as `kind` stays plain `string`, but silently falls through to
|
||||||
|
// `default` (the hard "couldn't read a firmware version" error) for every real
|
||||||
|
// stock-firmware version, flashable or newer alike -- onboarding was unusable for
|
||||||
|
// any device that ever reached this switch with an actual reported version.
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
case "custom":
|
case "custom":
|
||||||
if (!hasExtractedEvenHubFonts()) {
|
if (!hasExtractedEvenHubFonts()) {
|
||||||
@@ -203,14 +211,14 @@ export class OnboardingFirmwareCheckViewModel extends Observable {
|
|||||||
}
|
}
|
||||||
this.showCustomReady(version, capabilities, false);
|
this.showCustomReady(version, capabilities, false);
|
||||||
break;
|
break;
|
||||||
case "flashable":
|
case "flashable-stock":
|
||||||
this.setPhase("flashable");
|
this.setPhase("flashable");
|
||||||
this.headline = "Ready to Install";
|
this.headline = "Ready to Install";
|
||||||
this.status =
|
this.status =
|
||||||
`Your glasses run stock firmware ${version}. This is compatible — tap Install Firmware to flash ` +
|
`Your glasses run stock firmware ${version}. This is compatible — tap Install Firmware to flash ` +
|
||||||
"Faceclaw's custom firmware.";
|
"Faceclaw's custom firmware.";
|
||||||
break;
|
break;
|
||||||
case "newer":
|
case "newer-stock":
|
||||||
this.setPhase("newer");
|
this.setPhase("newer");
|
||||||
this.headline = "Unrecognized Firmware";
|
this.headline = "Unrecognized Firmware";
|
||||||
this.status =
|
this.status =
|
||||||
|
|||||||
Reference in new issue
Block a user