mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-18 16:56:32 +00:00
Remove remaining Promise.then
Change-type: patch
This commit is contained in:
parent
6202393637
commit
2eda6601c0
@ -277,7 +277,7 @@ driveScanner.start();
|
|||||||
|
|
||||||
let popupExists = false;
|
let popupExists = false;
|
||||||
|
|
||||||
window.addEventListener('beforeunload', event => {
|
window.addEventListener('beforeunload', async event => {
|
||||||
if (!flashState.isFlashing() || popupExists) {
|
if (!flashState.isFlashing() || popupExists) {
|
||||||
analytics.logEvent('Close application', {
|
analytics.logEvent('Close application', {
|
||||||
isFlashing: flashState.isFlashing(),
|
isFlashing: flashState.isFlashing(),
|
||||||
@ -297,14 +297,13 @@ window.addEventListener('beforeunload', event => {
|
|||||||
flashingWorkflowUuid,
|
flashingWorkflowUuid,
|
||||||
});
|
});
|
||||||
|
|
||||||
osDialog
|
try {
|
||||||
.showWarning({
|
const confirmed = await osDialog.showWarning({
|
||||||
confirmationLabel: 'Yes, quit',
|
confirmationLabel: 'Yes, quit',
|
||||||
rejectionLabel: 'Cancel',
|
rejectionLabel: 'Cancel',
|
||||||
title: 'Are you sure you want to close Etcher?',
|
title: 'Are you sure you want to close Etcher?',
|
||||||
description: messages.warning.exitWhileFlashing(),
|
description: messages.warning.exitWhileFlashing(),
|
||||||
})
|
});
|
||||||
.then(confirmed => {
|
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
analytics.logEvent('Close confirmed while flashing', {
|
analytics.logEvent('Close confirmed while flashing', {
|
||||||
flashInstanceUuid: flashState.getFlashUuid(),
|
flashInstanceUuid: flashState.getFlashUuid(),
|
||||||
@ -322,8 +321,9 @@ window.addEventListener('beforeunload', event => {
|
|||||||
flashingWorkflowUuid,
|
flashingWorkflowUuid,
|
||||||
});
|
});
|
||||||
popupExists = false;
|
popupExists = false;
|
||||||
})
|
} catch (error) {
|
||||||
.catch(exceptionReporter.report);
|
exceptionReporter.report(error);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function extendLock() {
|
function extendLock() {
|
||||||
|
@ -58,11 +58,9 @@ export async function getConfig(configUrl: string): Promise<any> {
|
|||||||
* @summary returns { path: String, cleanup: Function }
|
* @summary returns { path: String, cleanup: Function }
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* tmpFileAsync()
|
* const {path, cleanup } = await tmpFileAsync()
|
||||||
* .then({ path, cleanup } => {
|
|
||||||
* console.log(path)
|
* console.log(path)
|
||||||
* cleanup()
|
* cleanup()
|
||||||
* });
|
|
||||||
*/
|
*/
|
||||||
function tmpFileAsync(
|
function tmpFileAsync(
|
||||||
options: tmp.FileOptions,
|
options: tmp.FileOptions,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user