()
| 5 | static override id = 'End'; |
| 6 | |
| 7 | static override async bind(): Promise<void> { |
| 8 | this.engine.registerListener('end', { |
| 9 | keys: 'shift+q', |
| 10 | callback: () => { |
| 11 | if (this.engine.global('playing')) { |
| 12 | this.engine.alert('quit-warning', { |
| 13 | message: 'Confirm', |
| 14 | actions: [ |
| 15 | { |
| 16 | label: 'Quit', |
| 17 | listener: 'quit' |
| 18 | }, |
| 19 | { |
| 20 | label: 'Cancel', |
| 21 | listener: 'dismiss-alert' |
| 22 | } |
| 23 | ] |
| 24 | }); |
| 25 | } |
| 26 | } |
| 27 | }); |
| 28 | |
| 29 | this.engine.registerListener('quit', { |
| 30 | callback: () => { |
| 31 | this.engine.dismissAlert('quit-warning'); |
| 32 | |
| 33 | if (this.engine.global('playing') === true) { |
| 34 | this.engine.run('end'); |
| 35 | return; |
| 36 | } |
| 37 | |
| 38 | const bridge = getDesktopBridge(); |
| 39 | |
| 40 | if (bridge) { |
| 41 | bridge.send('quit-request'); |
| 42 | } |
| 43 | } |
| 44 | }); |
| 45 | } |
| 46 | |
| 47 | static override matchString([action]: string[]): boolean { |
| 48 | return action === 'end'; |
no test coverage detected