Skip to content

Commit

Permalink
fFix Cmd-W to close NWJS window
Browse files Browse the repository at this point in the history
  • Loading branch information
tillvit committed Aug 14, 2024
1 parent 79bc71b commit f9b4c85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export class App {
if (window.nw) {
const win = nw.Window.get()

nw.App.on("open", () => {
nw.App.on("open", args => {
console.log(args)
nw.Window.open(window.location.href)
})

Expand All @@ -92,7 +93,7 @@ export class App {
e.preventDefault()
win.reload()
}
if (e.key == "w" && (e.metaKey || e.ctrlKey)) {
if (e.code == "KeyW" && (e.metaKey || e.ctrlKey)) {
e.preventDefault()
win.close()
}
Expand Down

0 comments on commit f9b4c85

Please sign in to comment.