mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 19:26:33 +00:00
fix(gui): Allow undefined eta
Change-type: patch Signed-off-by: Alexis Svinartchouk <alexis@resin.io>
This commit is contained in:
parent
a237bfd930
commit
aaccd10c2a
@ -251,19 +251,17 @@ const storeReducer = (state = DEFAULT_STATE, action) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_.isUndefined(action.data.percentage)) {
|
if (!_.isUndefined(action.data.percentage) && !utils.isValidPercentage(action.data.percentage)) {
|
||||||
if (!utils.isValidPercentage(action.data.percentage)) {
|
|
||||||
throw errors.createError({
|
throw errors.createError({
|
||||||
title: `Invalid state percentage: ${action.data.percentage}`
|
title: `Invalid state percentage: ${action.data.percentage}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_.isNumber(action.data.eta)) {
|
if (!_.isUndefined(action.data.eta) && !_.isNumber(action.data.eta)) {
|
||||||
throw errors.createError({
|
throw errors.createError({
|
||||||
title: `Invalid state eta: ${action.data.eta}`
|
title: `Invalid state eta: ${action.data.eta}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return state.set('flashState', Immutable.fromJS(action.data))
|
return state.set('flashState', Immutable.fromJS(action.data))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user