Backward compatiility with sessionStorage

pull/1/head
yflory 4 years ago
parent cb8bf2cdeb
commit b1f29678ca

@ -2107,6 +2107,28 @@ define([
driveEvents: true //rdyCfg.driveEvents // Boolean
};
// FIXME Backward compatibility
if (sessionStorage.newPadFileData) {
common.fromFileData = JSON.parse(sessionStorage.newPadFileData);
var _parsed1 = Hash.parsePadUrl(common.fromFileData.href);
var _parsed2 = Hash.parsePadUrl(window.location.href);
if (_parsed1.hashData.type === 'pad') {
if (_parsed1.type !== _parsed2.type) { delete common.fromFileData; }
}
delete sessionStorage.newPadFileData;
}
if (sessionStorage.newPadPath) {
common.initialPath = sessionStorage.newPadPath;
delete sessionStorage.newPadPath;
}
if (sessionStorage.newPadTeam) {
common.initialTeam = sessionStorage.newPadTeam;
delete sessionStorage.newPadTeam;
}
var channelIsReady = waitFor();
var msgEv = Util.mkEvent();
@ -2332,7 +2354,7 @@ define([
postMessage("DISCONNECT");
});
}).nThen(function (waitFor) {
if (common.createReadme) {
if (common.createReadme || sessionStorage.createReadme) {
var data = {
driveReadme: Messages.driveReadme,
driveReadmeTitle: Messages.driveReadmeTitle,
@ -2342,7 +2364,7 @@ define([
}));
}
}).nThen(function (waitFor) {
if (common.migrateAnonDrive) {
if (common.migrateAnonDrive || sessionStorage.migrateAnonDrive) {
common.mergeAnonDrive(waitFor());
}
}).nThen(function (waitFor) {

@ -124,7 +124,7 @@ define([
SFrameChannel.create(msgEv, postMsg, waitFor(function (sfc) {
Utils.sframeChan = sframeChan = sfc;
window.CryptPad_loadingError = function (e) {
sfc.event('EV_LOADING_ERROR', e)
sfc.event('EV_LOADING_ERROR', e);
};
}));
});
@ -260,6 +260,11 @@ define([
}
// Otherwise, continue
}
// FIXME Backward compatibility
if (sessionStorage.newPadPassword && !newPadPassword) {
newPadPassword = sessionStorage.newPadPassword;
delete sessionStorage.newPadPassword;
}
if (!parsed.hashData) { // No hash, no need to check for a password

@ -39,7 +39,7 @@ define([
if (localStorage.login_user) {
$uname.val(localStorage.login_user);
delete loginStorage.login_user;
delete localStorage.login_user;
}
[ $uname, $passwd, $confirm]

Loading…
Cancel
Save