Fix readme pad not added at registration in sframe drive
This commit is contained in:
parent
1afbd4648d
commit
d2f1d0c0e9
@ -2236,6 +2236,35 @@ define([
|
|||||||
}
|
}
|
||||||
$iframe.load(w2); //cb);
|
$iframe.load(w2); //cb);
|
||||||
}
|
}
|
||||||
|
}).nThen(function (waitFor) {
|
||||||
|
if (sessionStorage.createReadme) {
|
||||||
|
var w = waitFor();
|
||||||
|
require(['/common/cryptget.js'], function (Crypt) {
|
||||||
|
var hash = common.createRandomHash();
|
||||||
|
Crypt.put(hash, Messages.driveReadme, function (e) {
|
||||||
|
if (e) {
|
||||||
|
console.error("Error while creating the default pad:", e);
|
||||||
|
return void w();
|
||||||
|
}
|
||||||
|
var href = '/pad/#' + hash;
|
||||||
|
var data = {
|
||||||
|
href: href,
|
||||||
|
title: Messages.driveReadmeTitle,
|
||||||
|
atime: new Date().toISOString(),
|
||||||
|
ctime: new Date().toISOString()
|
||||||
|
};
|
||||||
|
common.getFO().pushData(data, function (e, id) {
|
||||||
|
if (e) {
|
||||||
|
console.error("Error while creating the default pad:", e);
|
||||||
|
return void w();
|
||||||
|
}
|
||||||
|
common.getFO().add(id);
|
||||||
|
w();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
delete sessionStorage.createReadme;
|
||||||
|
});
|
||||||
|
}
|
||||||
}).nThen(function (waitFor) {
|
}).nThen(function (waitFor) {
|
||||||
if (sessionStorage.migrateAnonDrive) {
|
if (sessionStorage.migrateAnonDrive) {
|
||||||
var w = waitFor();
|
var w = waitFor();
|
||||||
|
|||||||
@ -2828,32 +2828,6 @@ define([
|
|||||||
refresh();
|
refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
var createReadme = function (proxy, cb) {
|
|
||||||
if (sessionStorage.createReadme) {
|
|
||||||
var hash = Cryptpad.createRandomHash();
|
|
||||||
Get.put(hash, Messages.driveReadme, function (e) {
|
|
||||||
if (e) { logError(e); }
|
|
||||||
var href = '/pad/#' + hash;
|
|
||||||
var data = {
|
|
||||||
href: href,
|
|
||||||
title: Messages.driveReadmeTitle,
|
|
||||||
atime: new Date().toISOString(),
|
|
||||||
ctime: new Date().toISOString()
|
|
||||||
};
|
|
||||||
filesOp.pushData(data, function (e, id) {
|
|
||||||
if (e) {
|
|
||||||
return void console.error("Error while creating the default pad:", e);
|
|
||||||
}
|
|
||||||
filesOp.add(id);
|
|
||||||
if (typeof(cb) === "function") { cb(); }
|
|
||||||
});
|
|
||||||
});
|
|
||||||
delete sessionStorage.createReadme;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (typeof(cb) === "function") { cb(); }
|
|
||||||
};
|
|
||||||
|
|
||||||
var fmConfig = {
|
var fmConfig = {
|
||||||
noHandlers: true,
|
noHandlers: true,
|
||||||
onUploaded: function (ev, data) {
|
onUploaded: function (ev, data) {
|
||||||
@ -2880,11 +2854,8 @@ define([
|
|||||||
};
|
};
|
||||||
APP.FM = common.createFileManager(fmConfig);
|
APP.FM = common.createFileManager(fmConfig);
|
||||||
|
|
||||||
createReadme(proxy, function () {
|
refresh();
|
||||||
refresh();
|
Cryptpad.removeLoadingScreen();
|
||||||
//APP.userList.onChange();
|
|
||||||
Cryptpad.removeLoadingScreen();
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var setHistory = function (bool, update) {
|
var setHistory = function (bool, update) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user