From ed2bc019b5356cfef420c4e60549a7b3de240266 Mon Sep 17 00:00:00 2001 From: asnewman Date: Thu, 26 Dec 2024 08:02:23 -1000 Subject: [PATCH] parse in go function --- index.js | 3 ++- main.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 6fade8c..9972de1 100644 --- a/index.js +++ b/index.js @@ -395,7 +395,8 @@ this.routes = routes; this.events = { ...events, - go: (path) => { + go: (rawPath) => { + const path = JSON.parse(rawPath); const removedSlash = path.startsWith("/") ? path.substring(1) : path; window.location.hash = `#${removedSlash}`; } diff --git a/main.js b/main.js index 08d38cf..2a411cd 100644 --- a/main.js +++ b/main.js @@ -12,7 +12,8 @@ class Ash { this.routes = routes; this.events = { ...events, - go: (path) => { + go: (rawPath) => { + const path = JSON.parse(rawPath) const removedSlash = path.startsWith("/") ? path.substring(1) : path; window.location.hash = `#${removedSlash}`; },