canvu-react 0.4.3 → 0.4.5

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/realtime.js CHANGED
@@ -3488,6 +3488,7 @@ function useRealtimeCanvasDocument(options) {
3488
3488
  const [loading, setLoading] = useState(false);
3489
3489
  const lastAppliedRevisionRef = useRef(null);
3490
3490
  const inFlightRevisionRef = useRef(null);
3491
+ const hasEverPropagatedItemsRef = useRef(false);
3491
3492
  const realtimeEnabled = enabled && session != null;
3492
3493
  const documentRevision = session?.document?.revision ?? null;
3493
3494
  const documentItems = session?.document?.items;
@@ -3526,6 +3527,12 @@ function useRealtimeCanvasDocument(options) {
3526
3527
  if (cancelled) return;
3527
3528
  if (inFlightRevisionRef.current !== documentRevision) return;
3528
3529
  lastAppliedRevisionRef.current = documentRevision;
3530
+ if (resolvedItems.length === 0 && hasEverPropagatedItemsRef.current) {
3531
+ return;
3532
+ }
3533
+ if (resolvedItems.length > 0) {
3534
+ hasEverPropagatedItemsRef.current = true;
3535
+ }
3529
3536
  onItemsChange(resolvedItems);
3530
3537
  }).finally(() => {
3531
3538
  if (inFlightRevisionRef.current === documentRevision) {