Skip to content

Commit

Permalink
3
Browse files Browse the repository at this point in the history
  • Loading branch information
cocktailpeanut committed Dec 17, 2024
1 parent 5b99135 commit 0c1e9c3
Show file tree
Hide file tree
Showing 4 changed files with 218 additions and 310 deletions.
4 changes: 4 additions & 0 deletions build/installer.nsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# https://github.com/electron-userland/electron-builder/issues/6865#issuecomment-1871121350
!macro customInit
Delete "$INSTDIR\Uninstall*.exe"
!macroend
15 changes: 12 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,9 @@ const attach = (event, webContents) => {
// - if it's a remote host, open in external browser
webContents.opened = true
} else {
console.log("will-navigate", { event, url })
// console.log("will-navigate", { event, url })
let host = new URL(url).host
let localhost = new URL(root_url).host
console.log({ host, localhost })
if (host !== localhost) {
event.preventDefault()
shell.openExternal(url);
Expand Down Expand Up @@ -590,7 +589,17 @@ document.querySelector("form").addEventListener("submit", (e) => {
if (BrowserWindow.getAllWindows().length === 0) createWindow(PORT)
})
app.on('window-all-closed', function () {
if (process.platform !== 'darwin') app.quit()
console.log("window-all-closed")
if (process.platform !== 'darwin') {
// Reset all shells before quitting
pinokiod.kernel.shell.reset()
// wait 1 second before quitting the app
// otherwise the app.quit() fails because the subprocesses are running
setTimeout(() => {
console.log("app.quit()")
app.quit()
}, 1000)
}
})
app.on('browser-window-created', (event, win) => {
if (win.type !== "splash") {
Expand Down
Loading

0 comments on commit 0c1e9c3

Please sign in to comment.