Skip to content

Commit

Permalink
Fix pause button and close project when stopped compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Jul 22, 2023
1 parent 909ffbc commit cff392c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/addons/pause.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,5 @@ export default function ({ scaffolding }) {
};

vm.setPaused = setPaused;
vm.isPaused = () => paused;
}
7 changes: 6 additions & 1 deletion src/packager/packager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,12 @@ cd "$(dirname "$0")"
vm.extensionManager.loadExtensionURL(extension);
}
${this.options.closeWhenStopped ? `vm.runtime.on('PROJECT_RUN_STOP', () => window.close());` : ''}
${this.options.closeWhenStopped ? `
vm.runtime.on('PROJECT_RUN_STOP', () => {
if (!vm.isPaused || !vm.isPaused()) {
window.close();
}
});` : ''}
${this.options.target.startsWith('nwjs-') ? `
if (typeof nw !== 'undefined') {
Expand Down

0 comments on commit cff392c

Please sign in to comment.