fix(donate): more relevant donate view, display also patreon donate :)

This commit is contained in:
Alexey Kasyanchuk
2018-04-30 13:05:16 +03:00
parent 61d35e03fb
commit f3e5edf6ec
3 changed files with 84 additions and 2 deletions

View File

@ -47,7 +47,8 @@ export const aboutMenuTemplate = {
click: () => {
const win = new BrowserWindow({
parent: BrowserWindow.getFocusedWindow(),
modal: true
modal: true,
width: 1000
})
win.setMenu(null)
win.loadURL(url.format({
@ -55,6 +56,19 @@ export const aboutMenuTemplate = {
protocol: "file:",
slashes: true
}))
const handleRedirect = (e, url) => {
if(url != win.webContents.getURL()) {
if(!url.includes('patreon'))
return
e.preventDefault()
shell.openExternal(url)
}
}
win.webContents.on('will-navigate', handleRedirect)
win.webContents.on('new-window', handleRedirect)
},
},
{