WebView: Remove redundant name property.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2022-02-03 00:21:33 -08:00
parent 5c83952ba1
commit 7fb0cfd176
4 changed files with 1 additions and 8 deletions

View File

@@ -23,5 +23,4 @@ export interface TabData {
role: TabRole;
name: string;
index: number;
webviewName: string;
}

View File

@@ -348,7 +348,7 @@ ${error}`,
AppMenu.setMenu(props);
if (props.activeTabIndex !== undefined) {
const activeTab = props.tabs[props.activeTabIndex];
mainWindow.setTitle(`Zulip - ${activeTab.webviewName}`);
mainWindow.setTitle(`Zulip - ${activeTab.name}`);
}
},
);

View File

@@ -23,7 +23,6 @@ interface WebViewProps {
tabIndex: number;
url: string;
role: TabRole;
name: string;
isActive: () => boolean;
switchLoading: (loading: boolean, url: string) => void;
onNetworkError: (index: number) => void;
@@ -63,7 +62,6 @@ export default class WebView {
${new HTML({html: this.props.nodeIntegration ? "nodeIntegration" : ""})}
${new HTML({html: this.props.preload ? 'preload="js/preload.js"' : ""})}
partition="persist:webviewsession"
name="${this.props.name}"
webpreferences="
contextIsolation=${!this.props.nodeIntegration},
spellcheck=${Boolean(

View File

@@ -371,7 +371,6 @@ class ServerManagerView {
tabIndex,
url: server.url,
role: "server",
name: server.alias,
hasPermission: (origin: string, permission: string) =>
origin === server.url && permission === "notifications",
isActive: () => index === this.activeTabIndex,
@@ -566,7 +565,6 @@ class ServerManagerView {
tabIndex,
url: tabProps.url,
role: "function",
name: tabProps.name,
isActive: () =>
this.functionalTabs.get(tabProps.name) === this.activeTabIndex,
switchLoading: (loading: boolean, url: string) => {
@@ -644,7 +642,6 @@ class ServerManagerView {
role: tab.props.role,
name: tab.props.name,
index: tab.props.index,
webviewName: tab.webview.props.name,
}));
}
@@ -1060,7 +1057,6 @@ class ServerManagerView {
);
serverTooltips[index].textContent = realmName;
this.tabs[index].props.name = realmName;
this.tabs[index].webview.props.name = realmName;
domain.alias = realmName;
DomainUtil.updateDomain(index, domain);