diff --git a/customize.dist/pages/index.js b/customize.dist/pages/index.js index c718b363f..8a8fa3773 100644 --- a/customize.dist/pages/index.js +++ b/customize.dist/pages/index.js @@ -47,8 +47,8 @@ define([ var href = '/'+ x[0] +'/'; var attr = isEnabled ? { href: href } : { onclick: function () { - var href = Hash.hashToHref('', 'login'); - var url = Hash.getNewPadURL(href, { href: href }); + var loginURL = Hash.hashToHref('', 'login'); + var url = Hash.getNewPadURL(loginURL, { href: href }); window.location.href = url; } }; diff --git a/www/common/common-hash.js b/www/common/common-hash.js index 42925d6d6..199c2cb54 100644 --- a/www/common/common-hash.js +++ b/www/common/common-hash.js @@ -236,7 +236,7 @@ Version 4: Data URL when not a realtime link yet (new pad or "static" app) parsed.ownerKey = getOwnerKey(options); }; - // Version 4: only login or newpad options, smae for all the apps + // Version 4: only login or newpad options, same for all the apps if (hashArr[1] && hashArr[1] === '4') { parsed.getHash = function (opts) { if (!opts || !Object.keys(opts).length) { return ''; } @@ -653,9 +653,6 @@ Version 4: Data URL when not a realtime link yet (new pad or "static" app) // Valid hash? if (parsed.hash) { if (!parsed.hashData) { return; } - // New pad: only newPadOpts allowed - if (Object.keys(parsed.hashData).length === 1 && - parsed.hashData.newPadOpts) { return true; } // Version should be a number if (typeof(parsed.hashData.version) === "undefined") { return; } // pads and files should have a base64 (or hex) key @@ -670,7 +667,7 @@ Version 4: Data URL when not a realtime link yet (new pad or "static" app) Hash.decodeDataOptions = function (opts) { var b64 = decodeURIComponent(opts); var str = Nacl.util.encodeUTF8(Nacl.util.decodeBase64(b64)); - return JSON.parse(str); + return Util.tryParse(str) || {}; }; Hash.encodeDataOptions = function (opts) { var str = JSON.stringify(opts); diff --git a/www/common/outer/local-store.js b/www/common/outer/local-store.js index d15c2e8c6..0aff1f9ce 100644 --- a/www/common/outer/local-store.js +++ b/www/common/outer/local-store.js @@ -94,6 +94,7 @@ define([ localStorage.removeItem(k); delete localStorage[k]; }); + sessionStorage.clear(); try { Object.keys(localStorage || {}).forEach(function (k) { // Remvoe everything in localStorage except CACHE and FS_hash