diff --git a/rpc.js b/rpc.js index 3442a4c96..489f8b725 100644 --- a/rpc.js +++ b/rpc.js @@ -407,7 +407,7 @@ var updateLimits = function (config, publicKey, cb) { if (publicKey) { var limit = limits[publicKey]; l = limit && typeof limit.limit === "number" ? - [limit.limit, limit.plan] : [defaultLimit, '']; + [limit.limit, limit.plan, limit.note] : [defaultLimit, '', '']; } cb(void 0, l); } catch (e) { @@ -431,7 +431,7 @@ var getLimit = function (Env, publicKey, cb) { Env.defaultStorageLimit: DEFAULT_LIMIT; var toSend = limit && typeof(limit.limit) === "number"? - [limit.limit, limit.plan] : [defaultLimit, '']; + [limit.limit, limit.plan, limit.note] : [defaultLimit, '', '']; cb(void 0, toSend); }; diff --git a/www/file/file-crypto.js b/www/file/file-crypto.js index 61e11ecdc..49ced7553 100644 --- a/www/file/file-crypto.js +++ b/www/file/file-crypto.js @@ -112,6 +112,11 @@ define([ }; var fetchDecryptedMetadata = function (src, key, cb) { + if (typeof(src) !== 'string') { + return window.setTimeout(function () { + cb('NO_SOURCE'); + }); + } fetchMetadata(src, function (e, buffer) { if (e) { return cb(e); } cb(void 0, decryptMetadata(buffer, key)); diff --git a/www/media/main.js b/www/media/main.js index 4b8f45ecf..81820f8c0 100644 --- a/www/media/main.js +++ b/www/media/main.js @@ -41,16 +41,9 @@ define([ }; var updateTitle = function (newTitle) { - Cryptpad.renamePad(newTitle, function (err, data) { - if (err) { - console.log("Couldn't set pad title"); - console.error(err); - return; - } - document.title = newTitle; - $bar.find('.' + Toolbar.constants.title).find('span.title').text(data); - $bar.find('.' + Toolbar.constants.title).find('input').val(data); - }); + var title = document.title = newTitle; + $bar.find('.' + Toolbar.constants.title).find('span.title').text(title); + $bar.find('.' + Toolbar.constants.title).find('input').val(title); }; var suggestName = function () {