fix(gui): Always show the "success" screen

Change-type: patch
Signed-off-by: Alexis Svinartchouk <alexis@resin.io>
This commit is contained in:
Alexis Svinartchouk 2018-09-11 14:00:41 +02:00
parent f3110ba018
commit 534f3a7469

View File

@ -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: {