|
|
@@ -302,10 +302,11 @@ const system = { |
|
|
|
// {"size":"","currentSize":"","unit":"","process":100,"hash":"QmPJ9i4z5UdoQpLH1DrkhZiTZra2rGicXiPabiLw4LvTmX"} |
|
|
|
uploadFile.FileSize = +size; |
|
|
|
uploadFile.IpfsCid = hash; |
|
|
|
const copyUploadFile = { ...uploadFile }; |
|
|
|
if(!maybeFile) { |
|
|
|
delete uploadFile.Id; |
|
|
|
delete copyUploadFile.Id; |
|
|
|
} |
|
|
|
const res = await fetchApi(`file/${maybeFile ? 'updateFile' : 'addFile'}`, uploadFile); |
|
|
|
const res = await fetchApi(`file/${maybeFile ? 'updateFile' : 'addFile'}`, copyUploadFile); |
|
|
|
wrapErrorHint(res); |
|
|
|
if(res.Code !== 0) { |
|
|
|
resolveError(res, uploadFile); |
|
|
@@ -320,7 +321,7 @@ const system = { |
|
|
|
} |
|
|
|
}); |
|
|
|
socket.on('error', e => { |
|
|
|
onErrorHandler(e, uploadFile); |
|
|
|
resolveError(e, uploadFile); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|