From 28e2663aa58e8917edc5445e8b4c31ce2cf2a6f8 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 23 Sep 2015 05:24:55 -0400 Subject: [PATCH] fix(operation) setListeners: show alert on last file when error --- lib/client/operation.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/client/operation.js b/lib/client/operation.js index 173c0752..ebbfcbd0 100644 --- a/lib/client/operation.js +++ b/lib/client/operation.js @@ -122,8 +122,11 @@ function setListeners(emitter, callback) { var wasError, + done, listeners = { progress: function(value) { + done = value === 100; + Images.setProgress(value); }, @@ -141,15 +144,19 @@ }, error: function(error) { - var msg = error + '\n Continue?', - is = confirm(msg); + var is; - if (is) { + wasError = true; + + if (done) + Dialog.alert(error); + else + is = Dialog.confirm(error + '\n Continue?'); + + if (is) emitter.continue(); - } else { - wasError = true; + else emitter.abort(); - } } }, events = Object.keys(listeners);