2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 03:19:01 +00:00

chore: add dev help code

This commit is contained in:
18alantom 2022-03-17 11:33:02 +05:30
parent 0b59dc74dc
commit 0412095342
4 changed files with 16 additions and 1 deletions

View File

@ -383,5 +383,8 @@ module.exports = {
},
t,
T,
store: {},
store: {
isDevelopment: false,
appVersion: '',
},
};

View File

@ -111,6 +111,7 @@ function createWindow() {
mainWindow.webContents.on('did-finish-load', () => {
mainWindow.webContents.send(IPC_CHANNELS.STORE_ON_WINDOW, {
appVersion: app.getVersion(),
isDevelopment,
});
});
}

View File

@ -41,6 +41,12 @@ async function reportError(errorLogObj: ErrorLog, cb?: Function) {
stack: errorLogObj.stack,
more: JSON.stringify(errorLogObj.more ?? {}),
};
if (frappe.store.isDevelopment) {
console.log('errorHandling');
console.log(body);
}
await ipcRenderer.invoke(IPC_ACTIONS.SEND_ERROR, JSON.stringify(body));
cb?.();
}

View File

@ -102,6 +102,11 @@ export async function connectToLocalDatabase(filePath) {
telemetry.start();
await telemetry.setCount();
if (frappe.store.isDevelopment) {
// @ts-ignore
window.telemetry = telemetry;
}
return { connectionSuccess: true, reason: '' };
}