Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.
TypeScript albumsexif-extractiongeocodinglive-photomotion-photophoto-galleryphoto-sharingwebgl-viewer
fix(tours): dismiss tour immediately and lazy-load driver.js
Timothy Yin496abb6279ad
diff --git a/app/components/AdminTours.client.vue b/app/components/AdminTours.client.vueindex 2bee73f5..13cfb4fd 100644--- a/app/components/AdminTours.client.vue+++ b/app/components/AdminTours.client.vue@@ -1,6 +1,5 @@<script setup lang="ts">-import { driver, type Driver, type DriveStep } from 'driver.js'-import 'driver.js/dist/driver.css'+import type { Driver, DriveStep } from 'driver.js'import { tourIds, type TourId } from '~~/shared/types/tours'const route = useRoute()const { user } = useUserSession()@@ -140,17 +139,18 @@ async function start() {]})if (!steps.length) return+ const [{ driver }] = await Promise.all([+ import('driver.js'),+ import('driver.js/dist/driver.css'),+ ])+ if (token !== generation) returnlet saving = falseasync function finish(status: 'completed' | 'skipped') {if (saving) returnsaving = true- const tour = active- const saved = await update(id as TourId, status)- saving = false- if (!saved) {- tour?.destroy()- if (active === tour) active = undefined- } else if (token === generation) stop()+ // Dismiss immediately so a slow status request cannot block the page.+ stop()+ await update(id as TourId, status)}active = driver({steps,