diff --git a/src/App.vue b/src/App.vue index 4441e9d..24f9cc7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -16,7 +16,7 @@ provide('activeTab', activeTab); let savedScrollPercentage = 0; const currentFrameIndex = ref(1); // 1 or 2, which iframe is currently visible -let isTransitioning = false; +const isTransitioning = ref(false); const activeFrame = computed(() => { return currentFrameIndex.value === 1 @@ -25,8 +25,8 @@ const activeFrame = computed(() => { }); const renderPreview = async (shouldReloadFromFile = false) => { - if (isTransitioning) return; - isTransitioning = true; + if (isTransitioning.value) return; + isTransitioning.value = true; // Determine which iframe is currently visible and which to render to const visibleFrame = @@ -35,7 +35,7 @@ const renderPreview = async (shouldReloadFromFile = false) => { currentFrameIndex.value === 1 ? previewFrame2.value : previewFrame1.value; if (!hiddenFrame) { - isTransitioning = false; + isTransitioning.value = false; return; } @@ -112,7 +112,7 @@ const renderPreview = async (shouldReloadFromFile = false) => { // Swap current frame currentFrameIndex.value = currentFrameIndex.value === 1 ? 2 : 1; - isTransitioning = false; + isTransitioning.value = false; }, 200); // Match CSS transition duration }, 50); // Small delay to ensure scroll is set }, 200); // Wait for PagedJS @@ -147,6 +147,10 @@ onMounted(() => renderPreview(true)); :class="{ shifted: activeTab.length > 0 }" > +