forked from Blendman974/faceclaw
Remove an unnecessary extra confirm step during flashing after you'd already confirmed on-lens
This commit is contained in:
1 parent
d63058765a
commit
a36da83247
1 file changed
+7
-18
@@ -23,7 +23,7 @@ import { resumeAutoReconnect, suppressAutoReconnect } from "../g2/reconnect-poli
|
|||||||
import { setOnboardingCompleted, setPreviewOnlyMode } from "./onboarding-state";
|
import { setOnboardingCompleted, setPreviewOnlyMode } from "./onboarding-state";
|
||||||
import { formatErrorMessage } from "../util/format-error";
|
import { formatErrorMessage } from "../util/format-error";
|
||||||
|
|
||||||
type FlashPhase = "intro" | "prompt" | "building" | "ready" | "flashing" | "flashed" | "error";
|
type FlashPhase = "intro" | "prompt" | "building" | "flashing" | "flashed" | "error";
|
||||||
|
|
||||||
export type FlashMode = "install" | "uninstall";
|
export type FlashMode = "install" | "uninstall";
|
||||||
|
|
||||||
@@ -167,8 +167,6 @@ export class OnboardingFlashViewModel extends Observable {
|
|||||||
switch (this._phase) {
|
switch (this._phase) {
|
||||||
case "intro":
|
case "intro":
|
||||||
return "Connect & Confirm";
|
return "Connect & Confirm";
|
||||||
case "ready":
|
|
||||||
return "Flash Now";
|
|
||||||
case "flashed":
|
case "flashed":
|
||||||
return "Finish";
|
return "Finish";
|
||||||
case "error":
|
case "error":
|
||||||
@@ -182,8 +180,6 @@ export class OnboardingFlashViewModel extends Observable {
|
|||||||
switch (this._phase) {
|
switch (this._phase) {
|
||||||
case "prompt":
|
case "prompt":
|
||||||
return "Cancel";
|
return "Cancel";
|
||||||
case "ready":
|
|
||||||
return "Not Now";
|
|
||||||
default:
|
default:
|
||||||
return "Back";
|
return "Back";
|
||||||
}
|
}
|
||||||
@@ -207,9 +203,6 @@ export class OnboardingFlashViewModel extends Observable {
|
|||||||
case "intro":
|
case "intro":
|
||||||
void this.beginPrompt();
|
void this.beginPrompt();
|
||||||
return;
|
return;
|
||||||
case "ready":
|
|
||||||
this.startFlashing();
|
|
||||||
return;
|
|
||||||
case "flashed":
|
case "flashed":
|
||||||
this.finish();
|
this.finish();
|
||||||
return;
|
return;
|
||||||
@@ -398,15 +391,9 @@ export class OnboardingFlashViewModel extends Observable {
|
|||||||
const build = this.mode === "uninstall" ? buildStockFirmware : buildCustomFirmware;
|
const build = this.mode === "uninstall" ? buildStockFirmware : buildCustomFirmware;
|
||||||
const result = await build((progress) => this.reportBuildProgress(progress));
|
const result = await build((progress) => this.reportBuildProgress(progress));
|
||||||
this.firmwarePath = result.path;
|
this.firmwarePath = result.path;
|
||||||
this.busy = false;
|
this.appendLog(`${this.noun} prepared and verified (${result.bytes.toLocaleString()} bytes), saved to ${result.path}`);
|
||||||
this.setPhase("ready");
|
// The user already said Yes on the lens; no second confirmation here.
|
||||||
this.headline = "Firmware Ready";
|
this.startFlashing();
|
||||||
this.status =
|
|
||||||
`The ${this.noun} is prepared and verified (${result.bytes.toLocaleString()} bytes).\n\n` +
|
|
||||||
"Tap Flash Now to write it to your glasses. Keep both lenses powered on and nearby — " +
|
|
||||||
"each lens takes a few minutes, and the glasses will reboot when each lens finishes. " +
|
|
||||||
"Do not close the app during flashing.";
|
|
||||||
this.appendLog(`saved to ${result.path}`);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.busy = false;
|
this.busy = false;
|
||||||
const message =
|
const message =
|
||||||
@@ -451,7 +438,9 @@ export class OnboardingFlashViewModel extends Observable {
|
|||||||
this.headline = "Flashing Firmware";
|
this.headline = "Flashing Firmware";
|
||||||
this.busy = true;
|
this.busy = true;
|
||||||
this.progress = 0;
|
this.progress = 0;
|
||||||
this.status = "Starting. Do not close the app or power off the glasses.";
|
this.status =
|
||||||
|
"Starting. Keep both lenses powered on and nearby — each lens takes a few minutes, " +
|
||||||
|
"and the glasses will reboot when each lens finishes. Do not close the app during flashing.";
|
||||||
|
|
||||||
this.disposeFlasher();
|
this.disposeFlasher();
|
||||||
const flasher = new FirmwareFlasher(this.addresses, this.firmwarePath);
|
const flasher = new FirmwareFlasher(this.addresses, this.firmwarePath);
|
||||||
|
|||||||
Reference in new issue
Block a user