chore(modal): drop the ?image=N soft-compat from G5.4
Operator confirmed they have no existing ?image=N bookmarks to preserve, so the soft-compat read on initial mount + router.replace strip is dead weight. The modal is now purely a Pinia overlay — no URL involvement on open OR initial mount. Drops 33 lines plus the now-unused vue-router imports in both ArtistGalleryTab (entire onMounted gone) and GalleryView (just the ?image=N block; the post_id/tag_id filter handling stays).
This commit is contained in:
@@ -11,9 +11,6 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
import { useArtistStore } from '../../stores/artist.js'
|
||||
import { useModalStore } from '../../stores/modal.js'
|
||||
import MasonryGrid from '../discovery/MasonryGrid.vue'
|
||||
@@ -24,21 +21,6 @@ const props = defineProps({
|
||||
|
||||
const store = useArtistStore()
|
||||
const modal = useModalStore()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
|
||||
onMounted(() => {
|
||||
// Audit 2026-06-02: same overlay treatment as GalleryView —
|
||||
// honor `?image=N` once for backward-compat, then strip the
|
||||
// query and let the modal live in Pinia-only state.
|
||||
const initial = parseInt(route.query.image, 10)
|
||||
if (!isNaN(initial)) {
|
||||
modal.open(initial)
|
||||
const q = { ...route.query }
|
||||
delete q.image
|
||||
router.replace({ query: q })
|
||||
}
|
||||
})
|
||||
|
||||
function openImage (id) {
|
||||
modal.open(id)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
<script setup>
|
||||
import { onMounted, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useGalleryStore } from '../stores/gallery.js'
|
||||
import { useModalStore } from '../stores/modal.js'
|
||||
import GalleryGrid from '../components/gallery/GalleryGrid.vue'
|
||||
@@ -37,7 +37,6 @@ import { useGallerySelectionStore } from '../stores/gallerySelection.js'
|
||||
const store = useGalleryStore()
|
||||
const modal = useModalStore()
|
||||
const sel = useGallerySelectionStore()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
onMounted(async () => {
|
||||
@@ -47,20 +46,6 @@ onMounted(async () => {
|
||||
else if (!isNaN(tagId)) store.setTagFilter(tagId)
|
||||
await store.loadInitial()
|
||||
await store.loadTimeline()
|
||||
// Audit 2026-06-02: modal is now a Pinia-only overlay (see
|
||||
// G5.4 design). The previous URL↔modal sync leaked the modal
|
||||
// across route changes and re-opened it on history back/forward.
|
||||
// We still honor `?image=N` as a one-shot deep-link opener so
|
||||
// existing bookmarks / shared URLs keep working; we strip the
|
||||
// query immediately via router.replace so the URL doesn't
|
||||
// re-trigger and no history entry is added.
|
||||
const initial = parseInt(route.query.image, 10)
|
||||
if (!isNaN(initial)) {
|
||||
modal.open(initial)
|
||||
const q = { ...route.query }
|
||||
delete q.image
|
||||
router.replace({ query: q })
|
||||
}
|
||||
})
|
||||
|
||||
watch(() => route.query.tag_id, (q) => {
|
||||
|
||||
Reference in New Issue
Block a user