mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-29 13:41:45 +02:00
fix: restore legacy hashbang repository links
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user