Use the user object in file manager if it exists

pull/1/head
yflory 8 years ago
parent 6778a7062d
commit c7e63f63fd

@ -122,7 +122,7 @@ define([
var init = function (f, Cryptpad) {
if (!Cryptpad) { return; }
var hash = localStorage.FS_hash;
var hash = Cryptpad.getUserHash() || localStorage.FS_hash;
var secret = Cryptpad.getSecrets(hash);
var listmapConfig = {
data: {},
@ -136,7 +136,9 @@ define([
var rt = window.rt = Listmap.create(listmapConfig);
rt.proxy.on('create', function (info) {
var realtime = info.realtime;
localStorage.FS_hash = Cryptpad.getEditHashFromKeys(info.channel, secret.keys);
if (!Cryptpad.getUserHash()) {
localStorage.FS_hash = Cryptpad.getEditHashFromKeys(info.channel, secret.keys);
}
window.patchText = TextPatcher.create({
realtime: realtime,
logging: true,

@ -1444,7 +1444,7 @@ define([
APP.homePageIframe = true;
}
var hash = window.location.hash.slice(1) || localStorage.FS_hash;
var hash = Cryptpad.getUserHash() || window.location.hash.slice(1) || localStorage.FS_hash;
var secret = Cryptpad.getSecrets(hash);
var readOnly = APP.readOnly = secret.keys && !secret.keys.editKeyStr;

Loading…
Cancel
Save