🐛 Fix: notification freeze the main-process after uploading with clipboard

ISSUES CLOSED: #824
This commit is contained in:
PiEgg
2022-01-16 20:22:23 +08:00
parent 58f96db967
commit 3a503151a4

View File

@@ -23,7 +23,9 @@ export const uploadClipboardFiles = async (): Promise<string> => {
body: img[0].imgUrl!,
icon: img[0].imgUrl
})
notification.show()
setTimeout(() => {
notification.show()
}, 100)
await GalleryDB.getInstance().insert(img[0])
// trayWindow just be created in mac/windows, not in linux
trayWindow?.webContents?.send('clipboardFiles', [])