mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 15:27:17 +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
|
||||
* openDriveSelector(DriveSelectorService);
|
||||
*/
|
||||
const openDriveSelector = (DriveSelectorService) => {
|
||||
DriveSelectorService.open().then((drive) => {
|
||||
const openDriveSelector = async (DriveSelectorService) => {
|
||||
try {
|
||||
const drive = await DriveSelectorService.open()
|
||||
if (!drive) {
|
||||
return
|
||||
}
|
||||
@ -118,7 +119,9 @@ const openDriveSelector = (DriveSelectorService) => {
|
||||
applicationSessionUuid: store.getState().toJS().applicationSessionUuid,
|
||||
flashingWorkflowUuid: store.getState().toJS().flashingWorkflowUuid
|
||||
})
|
||||
}).catch(exceptionReporter.report)
|
||||
} catch (error) {
|
||||
exceptionReporter.report(error)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user