mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-26 08:17:18 +00:00
Refactor the DriveSelector to use async-await
Change-type: patch Signed-off-by: Thodoris Greasidis <thodoris@balena.io>
This commit is contained in:
parent
abfc6be84d
commit
8177e98014
@ -104,8 +104,9 @@ const getDriveListLabel = () => {
|
|||||||
* @example
|
* @example
|
||||||
* openDriveSelector(DriveSelectorService);
|
* openDriveSelector(DriveSelectorService);
|
||||||
*/
|
*/
|
||||||
const openDriveSelector = (DriveSelectorService) => {
|
const openDriveSelector = async (DriveSelectorService) => {
|
||||||
DriveSelectorService.open().then((drive) => {
|
try {
|
||||||
|
const drive = await DriveSelectorService.open()
|
||||||
if (!drive) {
|
if (!drive) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -118,7 +119,9 @@ const openDriveSelector = (DriveSelectorService) => {
|
|||||||
applicationSessionUuid: store.getState().toJS().applicationSessionUuid,
|
applicationSessionUuid: store.getState().toJS().applicationSessionUuid,
|
||||||
flashingWorkflowUuid: store.getState().toJS().flashingWorkflowUuid
|
flashingWorkflowUuid: store.getState().toJS().flashingWorkflowUuid
|
||||||
})
|
})
|
||||||
}).catch(exceptionReporter.report)
|
} catch (error) {
|
||||||
|
exceptionReporter.report(error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user