Ask for confirmation when closing app during call

This commit is contained in:
ayumi-signal 2024-02-19 06:44:05 -08:00 committed by GitHub
parent c772f2abc5
commit 93c019dc30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 129 additions and 0 deletions

View file

@ -388,6 +388,19 @@ ipc.on('get-ready-for-shutdown', async () => {
}
});
ipc.on('maybe-request-close-confirmation', async () => {
const { maybeRequestCloseConfirmation } = window.Events;
if (!maybeRequestCloseConfirmation) {
ipc.send('received-close-confirmation', true);
return;
}
log.info('Requesting close confirmation.');
ipc.send('requested-close-confirmation');
const result = await maybeRequestCloseConfirmation();
ipc.send('received-close-confirmation', result);
});
ipc.on('show-release-notes', () => {
const { showReleaseNotes } = window.Events;
if (showReleaseNotes) {