mirror of
https://github.com/onionshare/onionshare.git
synced 2025-12-15 16:29:35 -05:00
Update the GUI when the browser has canceled an upload in Receive Mode. Don't increment the completed counter
This commit is contained in:
parent
1dbd82f74a
commit
51e98f40e7
2 changed files with 4 additions and 6 deletions
|
|
@ -332,14 +332,14 @@ class ReceiveModeRequest(Request):
|
|||
|
||||
self.told_gui_about_request = True
|
||||
|
||||
filename = secure_filename(filename)
|
||||
self.filename = secure_filename(filename)
|
||||
|
||||
self.progress[filename] = {
|
||||
self.progress[self.filename] = {
|
||||
'uploaded_bytes': 0,
|
||||
'complete': False
|
||||
}
|
||||
|
||||
f = ReceiveModeFile(self, filename, self.file_write_func, self.file_close_func)
|
||||
f = ReceiveModeFile(self, self.filename, self.file_write_func, self.file_close_func)
|
||||
if f.upload_error:
|
||||
self.web.common.log('ReceiveModeRequest', '_get_file_stream', 'Error creating file')
|
||||
self.upload_error = True
|
||||
|
|
@ -362,7 +362,7 @@ class ReceiveModeRequest(Request):
|
|||
if self.told_gui_about_request:
|
||||
upload_id = self.upload_id
|
||||
|
||||
if not self.web.stop_q.empty():
|
||||
if not self.web.stop_q.empty() or not self.progress[self.filename]['complete']:
|
||||
# Inform the GUI that the upload has canceled
|
||||
self.web.add_request(self.web.REQUEST_UPLOAD_CANCELED, self.path, {
|
||||
'id': upload_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue