mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Fix issues with WS upload
This commit is contained in:
parent
4996944ea7
commit
b14a170dd8
@ -75,7 +75,7 @@ Upload.status = function (Env, safeKey, filesize, _cb) { // FIXME FILES
|
||||
};
|
||||
|
||||
Upload.upload = function (Env, safeKey, chunk, cb) {
|
||||
Env.blobStore.upload(safeKey, chunk, cb);
|
||||
Env.blobStore.uploadWs(safeKey, chunk, cb);
|
||||
};
|
||||
|
||||
Upload.cancel = function (Env, safeKey, arg, cb) {
|
||||
|
||||
@ -282,6 +282,7 @@ var uploadWs = function (Env, safeKey, content, cb) {
|
||||
|
||||
var session = Env.getSession(safeKey);
|
||||
|
||||
/*
|
||||
if (typeof(session.currentUploadSize) !== 'number' ||
|
||||
typeof(session.pendingUploadSize) !== 'number') {
|
||||
// improperly initialized... maybe they didn't check before uploading?
|
||||
@ -292,6 +293,7 @@ var uploadWs = function (Env, safeKey, content, cb) {
|
||||
if (session.currentUploadSize > session.pendingUploadSize) {
|
||||
return cb('E_OVER_LIMIT');
|
||||
}
|
||||
*/
|
||||
|
||||
var stagePath = makeStagePath(Env, safeKey);
|
||||
|
||||
@ -779,6 +781,11 @@ BlobStore.create = function (config, _cb) {
|
||||
if (!isValidSafeKey(safeKey)) { return void cb('INVALID_SAFEKEY'); }
|
||||
isFile(makeStagePath(Env, safeKey), cb);
|
||||
},
|
||||
uploadWs: function (safeKey, content, _cb) {
|
||||
var cb = Util.once(Util.mkAsync(_cb));
|
||||
if (!isValidSafeKey(safeKey)) { return void cb('INVALID_SAFEKEY'); }
|
||||
uploadWs(Env, safeKey, content, Util.once(Util.mkAsync(cb)));
|
||||
},
|
||||
upload: function (safeKey, content, _cb) {
|
||||
var cb = Util.once(Util.mkAsync(_cb));
|
||||
if (!isValidSafeKey(safeKey)) { return void cb('INVALID_SAFEKEY'); }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user