From bfc7535d54750b26cc3186f537dcd323f3afa633 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Fri, 14 Mar 2025 18:50:25 -0700 Subject: [PATCH] chore: Remove outOfSync --- src/lib/components/View.svelte | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/lib/components/View.svelte b/src/lib/components/View.svelte index fc7873ab..246ebdf8 100644 --- a/src/lib/components/View.svelte +++ b/src/lib/components/View.svelte @@ -21,7 +21,6 @@ let rough: boolean; let view: HTMLDivElement | undefined = $state(); let error = $state(false); - let outOfSync = $state(false); let manualUpdate = true; // Set up panZoom state observer to update the store when pan/zoom changes @@ -51,7 +50,6 @@ let diagramType: string | undefined; try { if (container) { - outOfSync = false; manualUpdate = true; // Do not render if there is no change in Code/Config/PanZoom if (code === state.code && config === state.mermaid && rough === state.rough) { @@ -59,7 +57,6 @@ } if (!shouldRefreshView()) { - outOfSync = true; return; } @@ -113,8 +110,6 @@ error = false; } else if (manualUpdate) { manualUpdate = false; - } else if (code !== state.code || config !== state.mermaid) { - outOfSync = true; } } catch (error_) { console.error('view fail', error_); @@ -137,31 +132,14 @@ }); -{#if outOfSync} -
- Diagram out of sync.
- It will be updated automatically. -
-{/if} -
+ class={[shouldShowGrid && `grid-bg-${$mode}`, error && 'opacity-50', 'h-full w-full']}>