mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-29 14:16:36 +00:00
fix(gui): Always show the "success" screen
Change-type: patch Signed-off-by: Alexis Svinartchouk <alexis@resin.io>
This commit is contained in:
parent
f3110ba018
commit
534f3a7469
@ -85,22 +85,6 @@ const handleError = (error) => {
|
||||
terminate(EXIT_CODES.GENERAL_ERROR)
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary returns the last value in a Map
|
||||
* @param {Map} map - map
|
||||
* @returns {Any} the last value of the map (in insertion order)
|
||||
*
|
||||
* @example
|
||||
* const last = lastMapValue(map)
|
||||
*/
|
||||
const lastMapValue = (map) => {
|
||||
let value = null
|
||||
for (value of map.values()) {
|
||||
// eslint-disable-next-line no-empty
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
/**
|
||||
* @summary writes the source to the destinations and valiates the writes
|
||||
* @param {SourceDestination} source - source
|
||||
@ -127,10 +111,6 @@ const writeAndValidate = (source, destinations, verify, onProgress, onFail, onFi
|
||||
)
|
||||
})
|
||||
.then(({ failures, bytesWritten }) => {
|
||||
// If all destinations errored, treat the last fail as an error
|
||||
if (failures.size === destinations.length) {
|
||||
throw lastMapValue(failures)
|
||||
}
|
||||
const result = {
|
||||
bytesWritten,
|
||||
devices: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user