Merge pull request #870 from gnosis/feature/desktop-logs

Feature/desktop logs
This commit is contained in:
Mati Dastugue 2020-05-04 15:11:35 -03:00 committed by GitHub
commit e272fc8c0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -129,14 +129,18 @@ function createWindow() {
autoUpdater.init(mainWindow);
});
mainWindow.webContents.on('crashed', () => {
log.info('App Crashed');
mainWindow.webContents.on('crashed', (event) => {
log.info(`App Crashed: ${event}`);
mainWindow.reload();
});
mainWindow.on("closed", () => (mainWindow = null));
}
process.on('uncaughtException',function(error){
log.error(error);
});
app.userAgentFallback = process.platform ==='win32' ?
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.100 Safari/537.36' :
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) old-airport-include/1.0.0 Chrome Electron/7.1.7 Safari/537.36';

View File

@ -2,11 +2,21 @@
// It has the same sandbox as a Chrome extension.
const TransportNodeHid = require("@ledgerhq/hw-transport-node-hid").default;
const log = require('electron-log');
window.TransportNodeHid = TransportNodeHid;
window.isDesktop = true;
window.addEventListener('DOMContentLoaded', () => {
console.error = (...args) => {
log.error(...args)
}
console.warn = (...args) => {
log.warn(...args)
}
console.log = (...args) => {
log.info(...args)
}
const replaceText = (selector, text) => {
const element = document.getElementById(selector)
if (element) element.innerText = text