Skip to content

Commit 968cb1a

Browse files
authored
Hotfix: Browser navigation between Documents (#17783)
use `replaceState` over `pushState`
1 parent 5f291ba commit 968cb1a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Umbraco.Web.UI.Client/src/packages/core/workspace/controllers/workspace-is-new-redirect.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class UmbWorkspaceIsNewRedirectController extends UmbControllerBase {
3434
id: unique,
3535
});
3636
this.destroy();
37-
window.history.pushState({}, '', newPath);
37+
window.history.replaceState({}, '', newPath);
3838
}
3939
}
4040
}

src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/document-workspace-editor.element.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ export class UmbDocumentWorkspaceEditorElement extends UmbLitElement {
102102

103103
if (!route) {
104104
// TODO: Notice: here is a specific index used for fallback, this could be made more solid [NL]
105-
history.pushState({}, '', `${this.#workspaceRoute}/${routes[routes.length - 3].path}`);
105+
history.replaceState({}, '', `${this.#workspaceRoute}/${routes[routes.length - 3].path}`);
106106
return;
107107
}
108108

109-
history.pushState({}, '', `${this.#workspaceRoute}/${route?.path}`);
109+
history.replaceState({}, '', `${this.#workspaceRoute}/${route?.path}`);
110110
},
111111
});
112112
}

0 commit comments

Comments
 (0)