no need to redirect when removing tab. router handles this fine

This commit is contained in:
Niels Lyngsø
2024-12-11 15:17:53 +01:00
committed by Jacob Overgaard
parent eec7b01f1c
commit 5f291bab22

View File

@@ -269,9 +269,8 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements
#deleteTab(tabId?: string) {
if (!tabId) return;
this.#workspaceContext?.structure.removeContainer(null, tabId);
// TODO: We should only navigate away if it was the last tab and if it was the active one... [NL]
if (this.#tabsStructureHelper?.isOwnerChildContainer(tabId)) {
window.history.replaceState(null, '', this._routerPath + (this._routes[0]?.path ?? '/root'));
if (this._activeTabId === tabId) {
this._activeTabId = undefined;
}
}
async #addTab() {