Skip to content

Commit 4a7f622

Browse files
committed
Fixes the root path (NaN issue).
1 parent 15b76c6 commit 4a7f622

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/App.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ async function created() {
154154
initResults.push(await store.fetchCurrentBikeTag())
155155
156156
if (game && routeIsHome) {
157-
const tagnumber = parseInt(router.currentRoute.value.path.split('/')[1]) ?? undefined
157+
const tagnumber =
158+
router.currentRoute.value.path.length > 1
159+
? parseInt(router.currentRoute.value.path.split('/')[1])
160+
: undefined
158161
const params = { tagnumber }
159162
await router.push({ name: 'Home', params })
160163
}

0 commit comments

Comments
 (0)