implement more reliable check for whether a channel on the server is new
This commit is contained in:
@@ -140,12 +140,10 @@ define([
|
||||
}).nThen(function (waitFor) {
|
||||
// Check if the pad exists on server
|
||||
if (!window.location.hash) { isNewFile = true; return; }
|
||||
Cryptpad.getFileSize(window.location.href, waitFor(function (err, size) {
|
||||
if (typeof(size) === 'number' && size >= 108) {
|
||||
isNewFile = false;
|
||||
return;
|
||||
}
|
||||
isNewFile = true;
|
||||
|
||||
Cryptpad.isNewChannel(window.location.href, waitFor(function (e, isNew) {
|
||||
if (e) { return console.error(e); }
|
||||
isNewFile = Boolean(isNew);
|
||||
}));
|
||||
}).nThen(function () {
|
||||
var readOnly = secret.keys && !secret.keys.editKeyStr;
|
||||
|
||||
Reference in New Issue
Block a user