Hotfix: Browser navigation between Documents (#17783)

use `replaceState` over `pushState`
This commit is contained in:
Niels Lyngsø
2024-12-11 16:32:38 +01:00
committed by GitHub
parent 5f291bab22
commit 968cb1a981
2 changed files with 3 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ export class UmbWorkspaceIsNewRedirectController extends UmbControllerBase {
id: unique,
});
this.destroy();
window.history.pushState({}, '', newPath);
window.history.replaceState({}, '', newPath);
}
}
}

View File

@@ -102,11 +102,11 @@ export class UmbDocumentWorkspaceEditorElement extends UmbLitElement {
if (!route) {
// TODO: Notice: here is a specific index used for fallback, this could be made more solid [NL]
history.pushState({}, '', `${this.#workspaceRoute}/${routes[routes.length - 3].path}`);
history.replaceState({}, '', `${this.#workspaceRoute}/${routes[routes.length - 3].path}`);
return;
}
history.pushState({}, '', `${this.#workspaceRoute}/${route?.path}`);
history.replaceState({}, '', `${this.#workspaceRoute}/${route?.path}`);
},
});
}