Reset writer state on flash error (#330)

Not doing so leads the writer state to have a `progress` of `100%`,
while `isFlashing()` is `false`, which is an inconsistent state.

Fixes: https://github.com/resin-io/etcher/issues/327
Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
Juan Cruz Viotti 2016-04-15 16:43:42 -04:00
parent 0dcc7b22b8
commit 34ae49df38

View File

@ -249,7 +249,10 @@ app.controller('AppController', function(
AnalyticsService.logEvent('Flash error');
}
})
.catch(dialog.showError)
.catch(function(error) {
self.writer.resetState();
dialog.showError(error);
})
.finally(OSWindowProgressService.clear);
};
});