From 34ae49df3869f671a23005d0e3f267b7c667dec7 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 15 Apr 2016 16:43:42 -0400 Subject: [PATCH] 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 --- lib/browser/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/browser/app.js b/lib/browser/app.js index 66f42cc7..6bed737b 100644 --- a/lib/browser/app.js +++ b/lib/browser/app.js @@ -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); }; });