Skip to content

Commit

Permalink
[fix]: fix picgo server notification sender
Browse files Browse the repository at this point in the history
  • Loading branch information
TankNee committed Jul 8, 2021
1 parent b2b48ce commit 334498b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src-electron/main-process/api-invoker.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { webContents } from 'electron'
import { webContents, BrowserWindow } from 'electron'

let wcs = webContents.getFocusedWebContents()

async function sendNotification (notificationPayload) {
async function sendNotification (notificationPayload, event) {
if (!wcs) {
wcs = webContents.getFocusedWebContents()
wcs = BrowserWindow.fromWebContents(event.sender).webContents
}
return wcs.send('show-notification', notificationPayload)
}
Expand Down
2 changes: 1 addition & 1 deletion src-electron/main-process/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default {
msg: 'PicGo Upload Server Not Found!',
type: 'negative',
icon: 'delete'
}).catch(err => throw err)
}, event).catch(err => throw err)
}
})
return uploadResult
Expand Down

0 comments on commit 334498b

Please sign in to comment.