fix: restore legacy hashbang repository links

This commit is contained in:
Thomas Durieux
2026-09-14 14:32:00 +00:00
parent 8abdaf7119
commit 878dda1d37
2 changed files with 30 additions and 0 deletions
+5
View File
@@ -30,6 +30,11 @@ export function safeUrl(value) {
}
export function mountApplication(target = "#app", options = {}) {
// AngularJS links stored the repository route in the fragment. Normalize it
// before web history reads the URL, replacing the entry so Back still works.
if (!options.history && window.location.pathname === "/" && /^#!\/r\/[^/?#]+/.test(window.location.hash)) {
window.history.replaceState(window.history.state, "", window.location.hash.slice(2));
}
const events = new Map();
const http = createHttp(options.fetch);
let root;