Switch SPA navigation to history paths

This commit is contained in:
2026-05-27 21:21:49 +00:00
parent 02a89aee68
commit a0d1433154
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -585,7 +585,7 @@ function getOverview(item: MediaItem): string | null {
} }
function getItemHref(item: MediaItem): string { function getItemHref(item: MediaItem): string {
return `#/${item.type}/${item.id}` return `/${item.type}/${item.id}`
} }
function activateItem(item: MediaItem) { function activateItem(item: MediaItem) {
+1 -1
View File
@@ -118,7 +118,7 @@
class="cast-card media-card" class="cast-card media-card"
data-nav-cast-item="true" data-nav-cast-item="true"
v-bind="navAttrs(2 + movieVersions.length, castIndex)" v-bind="navAttrs(2 + movieVersions.length, castIndex)"
:href="`#/?q=${encodeURIComponent(castMember.name)}`" :href="`/search/${encodeURIComponent(castMember.name)}`"
:title="`Search for ${castMember.name}`" :title="`Search for ${castMember.name}`"
@click.prevent="handleCastSelect(castMember.name)" @click.prevent="handleCastSelect(castMember.name)"
> >
+2 -2
View File
@@ -33,8 +33,8 @@ defineEmits<{
function getItemHref(item: MediaItem): string | undefined { function getItemHref(item: MediaItem): string | undefined {
if (item.type === "episode") { if (item.type === "episode") {
const epData = item.data as EpisodeWithSeries const epData = item.data as EpisodeWithSeries
return `#/series/${epData.series.id}` return `/series/${epData.series.id}`
} }
return `#/${item.type}/${item.id}` return `/${item.type}/${item.id}`
} }
</script> </script>
+2 -2
View File
@@ -1,4 +1,4 @@
import { createRouter, createWebHashHistory } from "vue-router" import { createRouter, createWebHistory } from "vue-router"
import { defineComponent, h } from "vue" import { defineComponent, h } from "vue"
// Empty component - App.vue handles all rendering based on route meta // Empty component - App.vue handles all rendering based on route meta
@@ -9,7 +9,7 @@ const EmptyRouteComponent = defineComponent({
}) })
const router = createRouter({ const router = createRouter({
history: createWebHashHistory(), history: createWebHistory(),
scrollBehavior() { scrollBehavior() {
// Always scroll to top on navigation // Always scroll to top on navigation
return { top: 0 } return { top: 0 }