Skip to content

Commit

Permalink
ELECTRON-1482 - Update dependencies (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
KiranNiranjan authored and VishwasShashidhar committed Aug 18, 2019
1 parent 132b129 commit 04ae257
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,18 @@
"typescript": "3.1.1"
},
"dependencies": {
"archiver": "3.0.0",
"archiver": "3.1.1",
"async.map": "0.5.2",
"auto-launch": "5.0.5",
"classnames": "2.2.6",
"electron-dl": "1.14.0",
"electron-fetch": "1.3.0",
"electron-log": "2.2.17",
"electron-log": "3.0.7",
"electron-spellchecker": "git+https://github.com/symphonyoss/electron-spellchecker.git#v2.0.1",
"ffi": "git+https://github.com/symphonyoss/node-ffi.git#v1.2.8",
"filesize": "3.6.1",
"lodash.isequal": "4.5.0",
"react": "16.6.3",
"react-dom": "16.6.0",
"filesize": "4.1.2",
"react": "16.9.0",
"react-dom": "16.9.0",
"ref": "1.3.5",
"shell-path": "2.1.0"
},
Expand Down
21 changes: 9 additions & 12 deletions src/app/config-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { app, dialog } from 'electron';
import * as fs from 'fs';
import * as path from 'path';

import { omit } from 'lodash';
import * as util from 'util';
import { buildNumber } from '../../package.json';
import { isDevEnv, isMac } from '../common/env';
Expand All @@ -11,16 +10,6 @@ import { pick } from '../common/utils';

const writeFile = util.promisify(fs.writeFile);

const ignoreSettings = [
'minimizeOnClose',
'launchOnStartup',
'alwaysOnTop',
'url',
'memoryRefresh',
'bringToFront',
'isCustomTitleBar',
];

export interface IConfig {
url: string;
minimizeOnClose: boolean;
Expand Down Expand Up @@ -159,7 +148,15 @@ class Config {
const execPath = path.dirname(this.appPath);
const shouldUpdateUserConfig = execPath.indexOf('AppData\\Local\\Programs') !== -1 || isMac;
if (shouldUpdateUserConfig) {
const filteredFields: IConfig = omit(this.userConfig, ignoreSettings) as IConfig;
const {
minimizeOnClose,
launchOnStartup,
alwaysOnTop,
url,
memoryRefresh,
bringToFront,
isCustomTitleBar,
...filteredFields }: IConfig = this.userConfig as IConfig;
// update to the new build number
filteredFields.buildNumber = buildNumber;
logger.info(`config-handler: setting first time launch for build`, buildNumber);
Expand Down
2 changes: 1 addition & 1 deletion src/common/logger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { app, BrowserWindow } from 'electron';
import electronLog, { LogLevel, transports } from 'electron-log';
import electronLog, { ILogLevel as LogLevel, transports } from 'electron-log';
import * as fs from 'fs';
import * as path from 'path';
import * as util from 'util';
Expand Down
11 changes: 8 additions & 3 deletions src/common/whitelist-handler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import isEqual from 'lodash.isequal';

import { config } from '../app/config-handler';

const urlParts = /^(https?:\/\/)?([^/]*@)?(.+?)(:\d{2,5})?([/?].*)?$/;
Expand Down Expand Up @@ -99,7 +97,14 @@ export class WhitelistHandler {
* @returns {boolean}
*/
private matchDomains(parsedUrl: IURLObject, parsedWhitelist: IURLObject): boolean {
if (isEqual(parsedUrl, parsedWhitelist)) {
if (!parsedUrl || !parsedWhitelist) {
return false;
}
if (
parsedUrl.subdomain === parsedWhitelist.subdomain
&& parsedUrl.domain === parsedWhitelist.domain
&& parsedUrl.tld === parsedWhitelist.tld
) {
return true;
}

Expand Down

0 comments on commit 04ae257

Please sign in to comment.