Display the storage limit in the drive
This commit is contained in:
@@ -576,7 +576,7 @@ define([
|
||||
var data = makePad(href, name);
|
||||
getStore().pushData(data, function (e) {
|
||||
if (e) {
|
||||
if (e === 'E_OVER_LIMIT') {
|
||||
if (e === 'E_OVER_LIMIT' && AppConfig.enablePinLimit) {
|
||||
common.alert(Messages.pinLimitNotPinned, null, true);
|
||||
return;
|
||||
}
|
||||
@@ -725,14 +725,15 @@ define([
|
||||
};
|
||||
|
||||
var isOverPinLimit = common.isOverPinLimit = function (cb) {
|
||||
if (!common.isLoggedIn()) { return void cb(null, false); }
|
||||
if (!common.isLoggedIn() || !AppConfig.enablePinLimit) { return void cb(null, false); }
|
||||
var usage;
|
||||
var andThen = function (e, limit) {
|
||||
if (e) { return void cb(e); }
|
||||
var data = {usage: usage, limit: limit};
|
||||
if (usage > limit) {
|
||||
return void cb (null, true);
|
||||
return void cb (null, true, data);
|
||||
}
|
||||
return void cb (null, false);
|
||||
return void cb (null, false, data);
|
||||
};
|
||||
var todo = function (e, used) {
|
||||
usage = common.bytesToMegabytes(used);
|
||||
|
||||
@@ -570,19 +570,20 @@ define([
|
||||
var parentEl = findElement(files, filePath);
|
||||
var fileName = getAvailableName(parentEl, name || NEW_FILE_NAME);
|
||||
var href = '/' + type + '/#' + Cryptpad.createRandomHash();
|
||||
parentEl[fileName] = href;
|
||||
|
||||
pushFileData({
|
||||
href: href,
|
||||
title: fileName,
|
||||
atime: +new Date(),
|
||||
ctime: +new Date()
|
||||
});
|
||||
|
||||
var newPath = filePath.slice();
|
||||
newPath.push(fileName);
|
||||
cb({
|
||||
newPath: newPath
|
||||
}, function (err) {
|
||||
if (err) { return void cb(err); }
|
||||
parentEl[fileName] = href;
|
||||
var newPath = filePath.slice();
|
||||
newPath.push(fileName);
|
||||
cb(void 0, {
|
||||
newPath: newPath
|
||||
});
|
||||
});
|
||||
};
|
||||
var addFolder = exp.addFolder = function (folderPath, name, cb) {
|
||||
@@ -591,7 +592,7 @@ define([
|
||||
parentEl[folderName] = {};
|
||||
var newPath = folderPath.slice();
|
||||
newPath.push(folderName);
|
||||
cb({
|
||||
cb(void 0, {
|
||||
newPath: newPath
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user