Remove use of getView()
and replace with getViewByURL()
where necessary. (#2544)
* WIP * Replace getView with getViewByURL
This commit is contained in:
@@ -752,7 +752,7 @@ export class WindowManager {
|
||||
|
||||
const currentView = this.viewManager?.views.get(viewName);
|
||||
const cleanedPathName = urlUtils.cleanPathName(currentView?.tab.server.url.pathname || '', pathName);
|
||||
const redirectedViewName = urlUtils.getView(`${currentView?.tab.server.url}${cleanedPathName}`, Config.teams)?.name || viewName;
|
||||
const redirectedViewName = this.viewManager?.getViewByURL(`${currentView?.tab.server.url.toString().replace(/\/$/, '')}${cleanedPathName}`)?.name || viewName;
|
||||
if (this.viewManager?.closedViews.has(redirectedViewName)) {
|
||||
// If it's a closed view, just open it and stop
|
||||
this.viewManager.openClosedTab(redirectedViewName, `${currentView?.tab.server.url}${cleanedPathName}`);
|
||||
@@ -857,6 +857,14 @@ export class WindowManager {
|
||||
view?.reload();
|
||||
this.viewManager?.showByName(view?.name);
|
||||
}
|
||||
|
||||
getServerURLFromWebContentsId = (id: number) => {
|
||||
const viewName = this.getViewNameByWebContentsId(id);
|
||||
if (!viewName) {
|
||||
return undefined;
|
||||
}
|
||||
return this.viewManager?.views.get(viewName)?.tab.server.url;
|
||||
}
|
||||
}
|
||||
|
||||
const windowManager = new WindowManager();
|
||||
|
Reference in New Issue
Block a user