diff --git a/octoprint_sdwire/__init__.py b/octoprint_sdwire/__init__.py index e2d8b16..b690997 100644 --- a/octoprint_sdwire/__init__.py +++ b/octoprint_sdwire/__init__.py @@ -189,6 +189,7 @@ def sdwire_run_upload(): sdwire_mount() sdwire_copyfile(path, os.path.join(self.mdir.name, remote_filename), sdwire_set_progress) sdwire_umount() + sdwire_set_progress(-1) except Exception as e: failure_cb(filename, remote_filename, int(time.time() - start_time)) diff --git a/octoprint_sdwire/static/js/sdwire.js b/octoprint_sdwire/static/js/sdwire.js index 1ebdb26..59ca3b5 100644 --- a/octoprint_sdwire/static/js/sdwire.js +++ b/octoprint_sdwire/static/js/sdwire.js @@ -19,7 +19,11 @@ $(function() { } if (data.hasOwnProperty("progress")) { - self.filesViewModel._setProgressBar(data["progress"], 'Uploading to sdwire - ' + data["progress"] + '%...', false); + if (data["progress"] == -1) { + self.filesViewModel._setProgressBar(0, "", false); + } else { + self.filesViewModel._setProgressBar(data["progress"], 'Uploading to sdwire - ' + data["progress"] + '%...', false); + } } if (data.hasOwnProperty("error")) {