mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-08 07:00:54 +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(
|
||||
|
||||
@@ -52,7 +52,7 @@ export default function(state, emitter) {
|
||||
checkFiles();
|
||||
});
|
||||
|
||||
emitter.on('navigate', checkFiles);
|
||||
//emitter.on('navigate', checkFiles);
|
||||
|
||||
emitter.on('render', () => {
|
||||
lastRender = Date.now();
|
||||
|
||||
Reference in New Issue
Block a user