1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-17 00:33:17 +00:00

Remove empty catch blocks, and update tslint rule (#513)

This commit is contained in:
Oscar Hinton
2021-10-19 10:32:14 +02:00
committed by GitHub
parent 62011628d0
commit f09fb69882
38 changed files with 228 additions and 85 deletions

View File

@@ -1,13 +1,21 @@
import { app, BrowserWindow, screen } from 'electron';
import { ElectronConstants } from './electronConstants';
import {
app,
BrowserWindow,
screen,
} from 'electron';
import * as path from 'path';
import * as url from 'url';
import { isDev, isMacAppStore, isSnapStore } from './utils';
import { LogService } from 'jslib-common/abstractions/log.service';
import { StorageService } from 'jslib-common/abstractions/storage.service';
import { ElectronConstants } from './electronConstants';
import {
isDev,
isMacAppStore,
isSnapStore,
} from './utils';
const WindowEventHandlingDelay = 100;
const Keys = {
mainWindowSize: 'mainWindowSize',
@@ -21,8 +29,8 @@ export class WindowMain {
private windowStates: { [key: string]: any; } = {};
private enableAlwaysOnTop: boolean = false;
constructor(private storageService: StorageService, private hideTitleBar = false,
private defaultWidth = 950, private defaultHeight = 600,
constructor(private storageService: StorageService, private logService: LogService,
private hideTitleBar = false, private defaultWidth = 950, private defaultHeight = 600,
private argvCallback: (argv: string[]) => void = null,
private createWindowCallback: (win: BrowserWindow) => void) { }
@@ -224,7 +232,9 @@ export class WindowMain {
}
await this.storageService.save(configKey, this.windowStates[configKey]);
} catch (e) { }
} catch (e) {
this.logService.error(e);
}
}
private async getWindowState(configKey: string, defaultWidth: number, defaultHeight: number) {