From d779e879374064e1df3cdc1062da1f5b3ddca90e Mon Sep 17 00:00:00 2001 From: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> Date: Tue, 8 Feb 2022 15:20:53 -0500 Subject: [PATCH] Ensure pathname starts with `/` (#2000) --- src/main/windows/windowManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/windows/windowManager.ts b/src/main/windows/windowManager.ts index 3afcd6ab..587dbb19 100644 --- a/src/main/windows/windowManager.ts +++ b/src/main/windows/windowManager.ts @@ -542,7 +542,7 @@ export class WindowManager { handleBrowserHistoryPush = (e: IpcMainEvent, viewName: string, pathName: string) => { const currentView = this.viewManager?.views.get(viewName); - const cleanedPathName = pathName.replace(currentView?.tab.server.url.pathname || '', ''); + const cleanedPathName = currentView?.tab.server.url.pathname === '/' ? pathName : pathName.replace(currentView?.tab.server.url.pathname || '', ''); const redirectedViewName = urlUtils.getView(`${currentView?.tab.server.url}${cleanedPathName}`, Config.teams)?.name || viewName; if (this.viewManager?.closedViews.has(redirectedViewName)) { this.viewManager.openClosedTab(redirectedViewName, `${currentView?.tab.server.url}${cleanedPathName}`);