Ensure pathname starts with / (#2000)

This commit is contained in:
Devin Binnie
2022-02-08 15:20:53 -05:00
committed by GitHub
parent 54a1aefe52
commit d779e87937

View File

@@ -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}`);