@glassly/engine 0.4.0-dev.1029 → 0.4.0-dev.1031
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/engine.d.ts.map +1 -1
- package/build/engine.js +5 -3
- package/build/engine.js.map +1 -1
- package/build/generated/releaseMetadata.js +3 -3
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/services/CloudClientService.d.ts.map +1 -1
- package/build/services/CloudClientService.js +11 -8
- package/build/services/CloudClientService.js.map +1 -1
- package/build/services/SupportProfileSync.d.ts.map +1 -1
- package/build/services/SupportProfileSync.js +3 -0
- package/build/services/SupportProfileSync.js.map +1 -1
- package/build/stores/settings.d.ts.map +1 -1
- package/build/stores/settings.js +3 -1
- package/build/stores/settings.js.map +1 -1
- package/package.json +7 -7
- package/src/engine.ts +8 -6
- package/src/generated/releaseMetadata.ts +3 -3
- package/src/services/CloudClientService.ts +10 -5
- package/src/services/SupportProfileSync.ts +2 -0
- package/src/stores/settings.ts +3 -1
|
@@ -190,9 +190,16 @@ function resolveEndpoints(): {core: string; runtime: string} {
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
// Via init(), never construct(): init() holds the disable-cloud gate, and a
|
|
194
|
+
// client built past it opens the runtime socket and retries it forever.
|
|
195
|
+
function requireClient(): CloudClient {
|
|
196
|
+
if (!client) cloudClientService.init()
|
|
197
|
+
if (!client) throw new Error("Glassly cloud is disabled")
|
|
198
|
+
return client
|
|
199
|
+
}
|
|
200
|
+
|
|
193
201
|
function getCoreClient(): CloudCore {
|
|
194
|
-
|
|
195
|
-
const core = client?.core
|
|
202
|
+
const core = requireClient().core
|
|
196
203
|
if (!core) throw new Error("cloud client core not configured")
|
|
197
204
|
return core
|
|
198
205
|
}
|
|
@@ -207,9 +214,7 @@ function syncCoreAccessTokenToBluetooth(): Promise<string> {
|
|
|
207
214
|
}
|
|
208
215
|
|
|
209
216
|
async function syncCoreAccessTokenToBluetoothInternal(): Promise<string> {
|
|
210
|
-
|
|
211
|
-
const c = client
|
|
212
|
-
if (!c) throw new Error("cloud client not initialized")
|
|
217
|
+
const c = requireClient()
|
|
213
218
|
|
|
214
219
|
const token = await c.auth.getCoreToken()
|
|
215
220
|
if (c !== client) {
|
|
@@ -83,6 +83,8 @@ function armDebounce(generation: number): void {
|
|
|
83
83
|
|
|
84
84
|
async function sendCurrentSnapshot(force: boolean, generation = syncGeneration): Promise<void> {
|
|
85
85
|
if (!unsubscribe || generation !== syncGeneration) return
|
|
86
|
+
// Every send would fail into the retry backoff with no client to send through.
|
|
87
|
+
if (cloudClientService.isCloudDisabled()) return
|
|
86
88
|
if (sendingGeneration === generation) {
|
|
87
89
|
const fingerprint = snapshotFingerprint(buildSnapshot())
|
|
88
90
|
if (fingerprint !== lastSentFingerprint) queuedFingerprint = fingerprint
|
package/src/stores/settings.ts
CHANGED
|
@@ -762,12 +762,14 @@ export const SETTINGS: Record<string, Setting> = {
|
|
|
762
762
|
saveOnServer: true,
|
|
763
763
|
persist: true,
|
|
764
764
|
},
|
|
765
|
+
// Session-only: Position settings holds it on for stock G1, and a persisted
|
|
766
|
+
// true (app killed on that screen) blanks every glasses' display at boot.
|
|
765
767
|
screen_disabled: {
|
|
766
768
|
key: "screen_disabled",
|
|
767
769
|
defaultValue: () => false,
|
|
768
770
|
writable: true,
|
|
769
771
|
saveOnServer: false,
|
|
770
|
-
persist:
|
|
772
|
+
persist: false,
|
|
771
773
|
},
|
|
772
774
|
// glasses settings:
|
|
773
775
|
contextual_dashboard: {
|