@snowcone-app/ui 0.4.12 → 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/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
  }