feat: 添加微信数据库实时监控,聊天记录自动刷新

This commit is contained in:
电摇小子
2026-06-30 14:36:45 +08:00
parent 10dc74e2a1
commit 5a87a10d12
10 changed files with 294 additions and 35 deletions
+8
View File
@@ -28,6 +28,14 @@ const api = {
autoGetDbKey: () => ipcRenderer.invoke('key:autoGetDbKey'),
pasteAndSaveDbKey: () => ipcRenderer.invoke('key:pasteAndSaveDbKey'),
clearSavedDbKey: () => ipcRenderer.invoke('key:clearSavedDbKey'),
onWcdbChange: (callback: (payload: { type: string; json: string }) => void) => {
const listener = (
_event: Electron.IpcRendererEvent,
payload: { type: string; json: string }
): void => callback(payload)
ipcRenderer.on('wcdb-change', listener)
return () => ipcRenderer.removeListener('wcdb-change', listener)
},
onDbKeyStatus: (callback: (payload: { message: string }) => void) => {
const listener = (_event: Electron.IpcRendererEvent, payload: { message: string }): void =>
callback(payload)