fix(gui): Allow undefined eta

Change-type: patch
Signed-off-by: Alexis Svinartchouk <alexis@resin.io>
This commit is contained in:
Alexis Svinartchouk 2018-09-06 18:30:52 +02:00
parent a237bfd930
commit aaccd10c2a

View File

@ -251,19 +251,17 @@ const storeReducer = (state = DEFAULT_STATE, action) => {
})
}
if (!_.isUndefined(action.data.percentage)) {
if (!utils.isValidPercentage(action.data.percentage)) {
if (!_.isUndefined(action.data.percentage) && !utils.isValidPercentage(action.data.percentage)) {
throw errors.createError({
title: `Invalid state percentage: ${action.data.percentage}`
})
}
if (!_.isNumber(action.data.eta)) {
if (!_.isUndefined(action.data.eta) && !_.isNumber(action.data.eta)) {
throw errors.createError({
title: `Invalid state eta: ${action.data.eta}`
})
}
}
return state.set('flashState', Immutable.fromJS(action.data))
}