@walldock/agent 0.1.3 → 0.1.4
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/dist/sync.d.ts +1 -0
- package/dist/sync.js +5 -0
- package/package.json +1 -1
package/dist/sync.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare class SyncService {
|
|
|
17
17
|
private sse;
|
|
18
18
|
private tickInFlight;
|
|
19
19
|
private lastScreensFingerprint;
|
|
20
|
+
private invalidTokenHandled;
|
|
20
21
|
/** Per-process cache: stableId → wallpaperId we successfully applied */
|
|
21
22
|
private readonly applied;
|
|
22
23
|
constructor(api: AgentApi, callbacks: SyncCallbacks);
|
package/dist/sync.js
CHANGED
|
@@ -17,6 +17,7 @@ class SyncService {
|
|
|
17
17
|
sse = null;
|
|
18
18
|
tickInFlight = null;
|
|
19
19
|
lastScreensFingerprint = null;
|
|
20
|
+
invalidTokenHandled = false;
|
|
20
21
|
/** Per-process cache: stableId → wallpaperId we successfully applied */
|
|
21
22
|
applied = new Map();
|
|
22
23
|
constructor(api, callbacks) {
|
|
@@ -27,6 +28,7 @@ class SyncService {
|
|
|
27
28
|
this.stop();
|
|
28
29
|
this.context = context;
|
|
29
30
|
this.lastScreensFingerprint = null;
|
|
31
|
+
this.invalidTokenHandled = false;
|
|
30
32
|
this.applied.clear();
|
|
31
33
|
const sseUrl = `${this.api.endpoint.replace('/api/graphql', '')}/api/agent/events?token=${encodeURIComponent(context.token)}`;
|
|
32
34
|
this.sse = (0, sse_1.connectSse)(sseUrl, (type) => {
|
|
@@ -76,6 +78,9 @@ class SyncService {
|
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
notifyInvalidToken() {
|
|
81
|
+
if (this.invalidTokenHandled)
|
|
82
|
+
return;
|
|
83
|
+
this.invalidTokenHandled = true;
|
|
79
84
|
this.stop();
|
|
80
85
|
this.callbacks.onInvalidToken();
|
|
81
86
|
}
|