fix: optimize DB pull (#2589)

This commit is contained in:
Peng Xiao
2023-05-31 11:09:18 +08:00
committed by Himself65
parent e4ba72853d
commit 4abe62c9e0
17 changed files with 619 additions and 40 deletions
+11 -2
View File
@@ -21,9 +21,18 @@ export function registerEvents() {
// register events
for (const [namespace, namespaceEvents] of Object.entries(allEvents)) {
for (const [key, eventRegister] of Object.entries(namespaceEvents)) {
const subscription = eventRegister((...args: any) => {
const subscription = eventRegister((...args: any[]) => {
const chan = `${namespace}:${key}`;
logger.info('[ipc-event]', chan, args);
logger.info(
'[ipc-event]',
chan,
args.filter(
a =>
a !== undefined &&
typeof a !== 'function' &&
typeof a !== 'object'
)
);
getActiveWindows().forEach(win => win.webContents.send(chan, ...args));
});
app.on('before-quit', () => {