mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-07 14:40:55 +03:00
fix checking file early
This commit is contained in:
@@ -141,11 +141,11 @@ async function upload(
|
||||
let size = 0;
|
||||
while (!state.done) {
|
||||
const buf = state.value;
|
||||
ws.send(buf);
|
||||
|
||||
if (canceller.cancelled) {
|
||||
ws.close(4000, 'upload cancelled');
|
||||
throw new Error(0);
|
||||
}
|
||||
ws.send(buf);
|
||||
|
||||
onprogress([Math.min(streamInfo.fileSize, size), streamInfo.fileSize]);
|
||||
size += streamInfo.recordSize;
|
||||
@@ -174,7 +174,6 @@ export async function uploadWs(
|
||||
|
||||
return {
|
||||
cancel: function() {
|
||||
ws.close(4000, 'upload cancelled');
|
||||
canceller.cancelled = true;
|
||||
},
|
||||
result: upload(
|
||||
|
||||
Reference in New Issue
Block a user