1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-09 13:10:17 +00:00

Remove never changing constructor params

Window.main has a defaultWidth and defaultHeight that never change, so they do not need to get passed in from outside

hideTitleBar is always true, so there is no need to make it a param
This commit is contained in:
Daniel James Smith
2023-02-08 12:02:51 +01:00
parent e7fc65b699
commit bd54d632d9
2 changed files with 4 additions and 7 deletions

View File

@@ -98,9 +98,6 @@ export class Main {
this.windowMain = new WindowMain(
this.stateService,
this.logService,
true,
undefined,
undefined,
(arg) => this.processDeepLink(arg),
(win) => this.trayMain.setupWindowListeners(win)
);

View File

@@ -20,12 +20,12 @@ export class WindowMain {
private windowStates: { [key: string]: WindowState } = {};
private enableAlwaysOnTop = false;
readonly defaultWidth = 950;
readonly defaultHeight = 600;
constructor(
private stateService: StateService,
private logService: LogService,
private hideTitleBar = false,
private defaultWidth = 950,
private defaultHeight = 600,
private argvCallback: (argv: string[]) => void = null,
private createWindowCallback: (win: BrowserWindow) => void
) {}
@@ -118,7 +118,7 @@ export class WindowMain {
y: this.windowStates[mainWindowSizeKey].y,
title: app.name,
icon: process.platform === "linux" ? path.join(__dirname, "/images/icon.png") : undefined,
titleBarStyle: this.hideTitleBar && process.platform === "darwin" ? "hiddenInset" : undefined,
titleBarStyle: process.platform === "darwin" ? "hiddenInset" : undefined,
show: false,
backgroundColor: "#fff",
alwaysOnTop: this.enableAlwaysOnTop,