Merge branch 'limit' into staging
This commit is contained in:
@@ -744,8 +744,15 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
common.updatePinLimit = function (cb) {
|
||||
if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
|
||||
rpc.getFileListSize(cb);
|
||||
};
|
||||
|
||||
common.getPinLimit = function (cb) {
|
||||
cb(void 0, typeof(AppConfig.pinLimit) === 'number'? AppConfig.pinLimit: 1000);
|
||||
if (!pinsReady()) { return void cb('[RPC_NOT_READY]'); }
|
||||
rpc.getFileListSize(cb);
|
||||
//cb(void 0, typeof(AppConfig.pinLimit) === 'number'? AppConfig.pinLimit: 1000);
|
||||
};
|
||||
|
||||
common.isOverPinLimit = function (cb) {
|
||||
|
||||
@@ -121,6 +121,29 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
// Update the limit value for all the users and return the limit for your publicKey
|
||||
exp.updatePinLimits = function (cb) {
|
||||
rpc.send('UPDATE_LIMITS', undefined, function (e, response) {
|
||||
if (e) { return void cb(e); }
|
||||
if (response && typeof response === "number") {
|
||||
cb (void 0, response);
|
||||
} else {
|
||||
cb('INVALID_RESPONSE');
|
||||
}
|
||||
});
|
||||
};
|
||||
// Get the storage limit associated with your publicKey
|
||||
exp.getLimit = function (cb) {
|
||||
rpc.send('GET_LIMIT', undefined, function (e, response) {
|
||||
if (e) { return void cb(e); }
|
||||
if (response && typeof response === "number") {
|
||||
cb (void 0, response);
|
||||
} else {
|
||||
cb('INVALID_RESPONSE');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
cb(e, exp);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user