@snowcone-app/ui 0.4.13 → 0.4.14
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/services/CanvasExportService.ts +23 -0
- package/src/services/__tests__/CanvasExportService.leadingEdge.test.ts +60 -0
package/dist/index.js
CHANGED
|
@@ -8569,6 +8569,16 @@ var CanvasExportService = class _CanvasExportService {
|
|
|
8569
8569
|
this.sendStateNow(state);
|
|
8570
8570
|
return;
|
|
8571
8571
|
}
|
|
8572
|
+
const isIdle = !this.stateChangeThrottleTimeout && (!hasSentBefore || timeSinceLastSend >= settleMs);
|
|
8573
|
+
if (isIdle) {
|
|
8574
|
+
console.log(`[CES] handleStateChange #${callId}: LEADING send (idle ${hasSentBefore ? timeSinceLastSend : "forever"}ms)`);
|
|
8575
|
+
this.sendStateNow(state);
|
|
8576
|
+
this.stateChangeThrottleTimeout = setTimeout(() => {
|
|
8577
|
+
this.stateChangeThrottleTimeout = null;
|
|
8578
|
+
if (this.pendingCanvasState) this.sendStateNow(this.pendingCanvasState);
|
|
8579
|
+
}, settleMs);
|
|
8580
|
+
return;
|
|
8581
|
+
}
|
|
8572
8582
|
if (this.stateChangeThrottleTimeout) {
|
|
8573
8583
|
clearTimeout(this.stateChangeThrottleTimeout);
|
|
8574
8584
|
}
|