mirror of
https://github.com/status-im/safe-react.git
synced 2025-02-24 23:48:17 +00:00
Merge pull request #870 from gnosis/feature/desktop-logs
Feature/desktop logs
This commit is contained in:
commit
e272fc8c0f
@ -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';
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user