From c6f80329184913a1b30669f779b6384badba586e Mon Sep 17 00:00:00 2001 From: Lightling Date: Thu, 21 Mar 2024 01:26:37 -0400 Subject: [PATCH] fix jitter caused by gallery navigation reloading --- src/views/gallery/gallery-list.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/views/gallery/gallery-list.vue b/src/views/gallery/gallery-list.vue index 7a5528e..8dec3df 100644 --- a/src/views/gallery/gallery-list.vue +++ b/src/views/gallery/gallery-list.vue @@ -28,13 +28,14 @@ const router = useRouter() let config: GalleryList = null! const ready = ref(false) +const galleryReady = ref(false) const entries = ref({} as GalleryEntries) const variants = ref(validateVariants(props.variants)) const hasWarnings = ref(false) const hideWarnings = defineModel('showWarnings', { type: Boolean }) const onDisplayEntries = () => { - ready.value = false + galleryReady.value = false let currentEntries = config.entries if (!!variants.value) { variants.value.forEach((variant) => { @@ -43,7 +44,7 @@ const onDisplayEntries = () => { } entries.value = currentEntries hasWarnings.value = !!Object.values(entries.value).find(other => !!other.warning) - setTimeout(() => ready.value = true) + setTimeout(() => galleryReady.value = true) } const onTileClicked = (clickEvent: { event: Event, id: string }) => { @@ -87,6 +88,7 @@ onMounted(async () => { document.title = routeConfig.title hideWarnings.value = storage.read(`${storageId}::hideWarnings`) || false onDisplayEntries() + ready.value = true }) @@ -115,7 +117,7 @@ onMounted(async () => { ) Transition .gallery( - v-if='ready' + v-if='galleryReady' ) GalleryTile( v-for='(entry, id) in entries'