handle new error codes
This commit is contained in:
parent
d9f128e923
commit
310909dc9e
@ -99,6 +99,12 @@ define([
|
|||||||
|
|
||||||
Cryptpad.uploadStatus(estimate, function (e, pending) {
|
Cryptpad.uploadStatus(estimate, function (e, pending) {
|
||||||
if (e) {
|
if (e) {
|
||||||
|
if (e === 'TOO_LARGE') {
|
||||||
|
return void Cryptpad.alert(Messages.upload_tooLarge);
|
||||||
|
}
|
||||||
|
if (e === 'NOT_ENOUGH_SPACE') {
|
||||||
|
return void Cryptpad.alert(Messages.upload_notEnoughSpace);
|
||||||
|
}
|
||||||
console.error(e);
|
console.error(e);
|
||||||
return void Cryptpad.alert(Messages.upload_serverError);
|
return void Cryptpad.alert(Messages.upload_serverError);
|
||||||
}
|
}
|
||||||
@ -108,7 +114,9 @@ define([
|
|||||||
return void Cryptpad.confirm(Messages.upload_uploadPending, function (yes) {
|
return void Cryptpad.confirm(Messages.upload_uploadPending, function (yes) {
|
||||||
if (!yes) { return; }
|
if (!yes) { return; }
|
||||||
Cryptpad.uploadCancel(function (e, res) {
|
Cryptpad.uploadCancel(function (e, res) {
|
||||||
if (e) { return void console.error(e); }
|
if (e) {
|
||||||
|
return void console.error(e);
|
||||||
|
}
|
||||||
console.log(res);
|
console.log(res);
|
||||||
next(again);
|
next(again);
|
||||||
});
|
});
|
||||||
@ -243,7 +251,7 @@ define([
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
counter--;
|
counter--;
|
||||||
if (counter <= 0) {
|
if (counter <= 0) {
|
||||||
$label.removeClass('hovering'); // FIXME Can get stuck...
|
$label.removeClass('hovering');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -254,6 +262,8 @@ define([
|
|||||||
})
|
})
|
||||||
.on('drop', function (e) {
|
.on('drop', function (e) {
|
||||||
var dropped = e.originalEvent.dataTransfer.files;
|
var dropped = e.originalEvent.dataTransfer.files;
|
||||||
|
counter = 0;
|
||||||
|
$label.removeClass('hovering');
|
||||||
handleFile(dropped[0]);
|
handleFile(dropped[0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user