From 4e7bb57129a01928d416d3d8af29475998578de8 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 31 Jan 2020 16:44:08 +0100 Subject: [PATCH] Fix debug app --- www/common/sframe-common-outer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index c5bd1ffb1..75f8afb9b 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -31,6 +31,7 @@ define([ var initialPathInDrive; var currentPad = window.CryptPad_location = { + app: '', href: cfg.href || window.location.href, hash: cfg.hash || window.location.hash }; @@ -172,6 +173,8 @@ define([ }); }); + var parsed = Utils.Hash.parsePadUrl(currentPad.href); + currentPad.app = parsed.type; if (cfg.getSecrets) { var w = waitFor(); // No password for drive, profile and todo @@ -183,7 +186,6 @@ define([ }); })); } else { - var parsed = Utils.Hash.parsePadUrl(currentPad.href); var todo = function () { secret = Utils.secret = Utils.Hash.getSecrets(parsed.type, parsed.hash, password); Cryptpad.getShareHashes(secret, waitFor(function (err, h) { @@ -460,7 +462,7 @@ define([ additionalPriv.registeredOnly = true; } - if (['debug', 'profile'].indexOf(parsed.type) !== -1) { + if (['debug', 'profile'].indexOf(currentPad.app) !== -1) { additionalPriv.hashes = hashes; }