Unverified Commit 145eda6a authored by Tasso Evangelista's avatar Tasso Evangelista Committed by GitHub

Merge pull request #1036 from RocketChat/break/update-dependencies

[BREAK] Update dependencies
parents 1d67b856 cb880ff0
......@@ -31,20 +31,18 @@
},
"dependencies": {
"@paulcbetts/system-idle-time": "^1.0.4",
"electron-updater": "3.0.4",
"freedesktop-notifications": "^1.2.3",
"electron-updater": "^4.0.5",
"freedesktop-notifications": "^1.4.0",
"fs-jetpack": "^2.2.0",
"lodash": "^4.17.11",
"spellchecker": "^3.5.0",
"tmp": "^0.0.33"
},
"optionalDependencies": {},
"devDependencies": {
"@rocket.chat/eslint-config": "^0.1.2",
"chai": "^4.2.0",
"conventional-changelog-cli": "^2.0.11",
"electron": "^2.0.14",
"electron-builder": "^20.28.4",
"electron": "^3.0.10",
"electron-builder": "^20.38.2",
"electron-mocha": "^6.0.4",
"eslint": "^5.9.0",
"gulp": "^3.9.1",
......@@ -66,7 +64,7 @@
"spectron": "^5.0.0"
},
"devEngines": {
"node": ">=7.x",
"node": ">=8.12.x",
"npm": ">=4.x",
"yarn": ">=0.21.3"
}
......
......@@ -53,15 +53,6 @@ const parseProtocolUrls = (args) =>
const addServers = (protocolUrls) => parseProtocolUrls(protocolUrls)
.forEach((serverUrl) => addServer(serverUrl));
const isSecondInstance = app.makeSingleInstance(async(argv) => {
(await getMainWindow()).show();
addServers(argv.slice(2));
});
if (isSecondInstance && !process.mas) {
app.quit();
}
// macOS only
app.on('open-url', (event, url) => {
event.preventDefault();
......@@ -81,19 +72,31 @@ if (process.platform === 'linux') {
app.disableHardwareAcceleration();
}
app.on('ready', async() => {
unsetDefaultApplicationMenu();
appData.initialize();
const mainWindow = await getMainWindow();
certificate.initWindow(mainWindow);
autoUpdate();
});
ipcMain.on('getSystemIdleTime', (event) => {
event.returnValue = idle.getIdleTime();
});
process.on('unhandledRejection', console.error.bind(console));
const gotTheLock = app.requestSingleInstanceLock();
if (gotTheLock) {
app.on('second-instance', async(event, argv) => {
(await getMainWindow()).show();
addServers(argv.slice(2));
});
app.on('ready', async() => {
unsetDefaultApplicationMenu();
appData.initialize();
const mainWindow = await getMainWindow();
certificate.initWindow(mainWindow);
autoUpdate();
});
} else {
app.quit();
}
import { app, screen } from 'electron';
import jetpack from 'fs-jetpack';
import { debounce } from 'lodash';
const debounce = (f, delay) => {
let call;
let timeout;
const ret = function(...args) {
call = () => f.apply(this, args);
clearTimeout(timeout);
timeout = setTimeout(call, delay);
};
ret.flush = () => {
clearTimeout(timeout);
call();
};
return ret;
};
export default (name, defaults) => {
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment