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

View File

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