2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

chore: rename renderer to main cause bug

This commit is contained in:
18alantom 2022-03-16 20:26:18 +05:30
parent 33e035e38c
commit 90dece4984
2 changed files with 7 additions and 9 deletions

View File

@ -2,8 +2,8 @@ import { ipcRenderer } from 'electron';
import frappe from 'frappe'; import frappe from 'frappe';
import { createApp } from 'vue'; import { createApp } from 'vue';
import models from '../models'; import models from '../models';
import App from './App.vue'; import App from './App';
import FeatherIcon from './components/FeatherIcon.vue'; import FeatherIcon from './components/FeatherIcon';
import config, { ConfigKeys } from './config'; import config, { ConfigKeys } from './config';
import { getErrorHandled, handleError } from './errorHandling'; import { getErrorHandled, handleError } from './errorHandling';
import { incrementOpenCount } from './renderer/helpers'; import { incrementOpenCount } from './renderer/helpers';
@ -19,7 +19,6 @@ import { setLanguageMap, stringifyCircular } from './utils';
} }
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
// @ts-ignore
window.config = config; window.config = config;
} }
@ -31,7 +30,6 @@ import { setLanguageMap, stringifyCircular } from './utils';
ipcRenderer.send = getErrorHandled(ipcRenderer.send); ipcRenderer.send = getErrorHandled(ipcRenderer.send);
ipcRenderer.invoke = getErrorHandled(ipcRenderer.invoke); ipcRenderer.invoke = getErrorHandled(ipcRenderer.invoke);
// @ts-ignore
window.frappe = frappe; window.frappe = frappe;
window.onerror = (message, source, lineno, colno, error) => { window.onerror = (message, source, lineno, colno, error) => {
@ -54,7 +52,7 @@ import { setLanguageMap, stringifyCircular } from './utils';
frappe() { frappe() {
return frappe; return frappe;
}, },
platform(): string { platform() {
switch (process.platform) { switch (process.platform) {
case 'win32': case 'win32':
return 'Windows'; return 'Windows';
@ -74,7 +72,7 @@ import { setLanguageMap, stringifyCircular } from './utils';
}); });
app.config.errorHandler = (err, vm, info) => { app.config.errorHandler = (err, vm, info) => {
const more: Record<string, unknown> = { const more = {
info, info,
}; };
@ -86,14 +84,14 @@ import { setLanguageMap, stringifyCircular } from './utils';
more.props = stringifyCircular(vm.$props ?? {}, true, true); more.props = stringifyCircular(vm.$props ?? {}, true, true);
} }
handleError(false, err as Error, more); handleError(false, err, more);
console.error(err, vm, info); console.error(err, vm, info);
}; };
incrementOpenCount(); incrementOpenCount();
app.mount('body'); app.mount('body');
process.on('unhandledRejection', (error: Error) => { process.on('unhandledRejection', (error) => {
handleError(true, error); handleError(true, error);
}); });

View File

@ -6,7 +6,7 @@ module.exports = {
electronBuilder: { electronBuilder: {
nodeIntegration: true, nodeIntegration: true,
mainProcessFile: 'main.ts', mainProcessFile: 'main.ts',
rendererProcessFile: 'src/renderer.ts', // rendererProcessFile: 'src/renderer.js',
disableMainProcessTypescript: false, disableMainProcessTypescript: false,
mainProcessTypeChecking: true, mainProcessTypeChecking: true,
chainWebpackRendererProcess: (config) => { chainWebpackRendererProcess: (config) => {