Skip to content

Commit

Permalink
chore: remove extra checks for hash
Browse files Browse the repository at this point in the history
Hash is never included in `window.location.pathname`
  • Loading branch information
iisakkirotko committed Oct 22, 2024
1 parent eb8b827 commit 916e8cf
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions solara/widgets/vue/navigator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ modules.export = {
this.location = href;
};
let location = window.location.pathname.slice(solara.rootPath.length);
// take of the anchor
if (location.indexOf("#") !== -1) {
location = location.slice(0, location.indexOf("#"));
}
this.location = location + window.location.search;
window.addEventListener("popstate", this.onPopState);
window.addEventListener("scroll", this.onScroll);
Expand All @@ -47,10 +43,6 @@ modules.export = {
throw `window.location.pathname = ${window.location.pathname}, but it should start with the solara.rootPath = ${solara.rootPath}`;
}
let newLocation = window.location.pathname.slice(solara.rootPath.length);
// the router/server shouldn't care about the hash, that's for the frontend
if (newLocation.indexOf("#") !== -1) {
newLocation = newLocation.slice(0, newLocation.indexOf("#"));
}
this.location = newLocation + window.location.search;
if (event.state) {
const top = event.state.top;
Expand Down

0 comments on commit 916e8cf

Please sign in to comment.