Skip to content

Commit

Permalink
Clean progress bar after copying to sdwire.
Browse files Browse the repository at this point in the history
  • Loading branch information
arekm committed Jul 23, 2022
1 parent c4a8bfb commit b3f2fe2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions octoprint_sdwire/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 5 additions & 1 deletion octoprint_sdwire/static/js/sdwire.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down

0 comments on commit b3f2fe2

Please sign in to comment.