fix: trigger ERPNext sync action to initiate data synchronization

This commit is contained in:
AbleKSaju
2025-05-30 15:58:08 +05:30
parent d647978644
commit 66c70797fc
5 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -3,5 +3,5 @@ const { parentPort } = require('worker_threads');
if (parentPort) {
// eslint-disable-next-line
parentPort.postMessage({ type: 'trigger-frontend-action' });
parentPort.postMessage({ type: 'trigger-erpnext-sync' });
}
+1 -1
View File
@@ -31,7 +31,7 @@ export async function initScheduler(interval: string) {
});
bree.on('worker created', () => {
main.mainWindow?.webContents.send('trigger-frontend-action');
main.mainWindow?.webContents.send('trigger-erpnext-sync');
});
await bree.start();
+1 -1
View File
@@ -215,7 +215,7 @@ const ipc = {
},
registerTriggerFrontendActionListener(listener: IPCRendererListener) {
ipcRenderer.on(IPC_CHANNELS.TRIGGER_FRONTEND_ACTION, listener);
ipcRenderer.on(IPC_CHANNELS.TRIGGER_ERPNEXT_SYNC, listener);
},
registerConsoleLogListener(listener: IPCRendererListener) {
@@ -58,6 +58,9 @@ export class AccountingSettings extends Doc {
enableLead: () => {
return !!this.enableLead;
},
enableERPNextSync: () => {
return !!this.enableERPNextSync;
},
enableInvoiceReturns: () => {
return !!this.enableInvoiceReturns;
},
+1 -1
View File
@@ -46,9 +46,9 @@ export enum IPC_ACTIONS {
// ipcMain.send(...)
export enum IPC_CHANNELS {
TRIGGER_ERPNEXT_SYNC = 'trigger-erpnext-sync',
LOG_MAIN_PROCESS_ERROR = 'main-process-error',
CONSOLE_LOG = 'console-log',
TRIGGER_FRONTEND_ACTION = 'trigger-frontend-action',
}
export enum DB_CONN_FAILURE {