From 234f28464754d7671ff777a30268e2d99919c12f Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 26 May 2020 16:53:22 +0200 Subject: [PATCH] Fix request access button when the pad is not stored --- www/common/inner/access.js | 2 +- www/common/inner/common-modal.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/www/common/inner/access.js b/www/common/inner/access.js index adc5bc15b..b2705208f 100644 --- a/www/common/inner/access.js +++ b/www/common/inner/access.js @@ -894,7 +894,7 @@ define([ if (parsed.hashData.type !== 'pad' || parsed.type === 'drive') { return h('div', content); } // Request edit access - if (data.roHref && !data.href) { + if (common.isLoggedIn() && ((data.roHref && !data.href) || data.fakeHref)) { var requestButton = h('button.btn.btn-secondary.no-margin.cp-access-margin-right', Messages.requestEdit_button); var requestBlock = h('p', requestButton); diff --git a/www/common/inner/common-modal.js b/www/common/inner/common-modal.js index 2131719cb..fae660bfe 100644 --- a/www/common/inner/common-modal.js +++ b/www/common/inner/common-modal.js @@ -42,6 +42,7 @@ define([ // Access modal and the pad is not stored: we're not an owner // so we don't need the correct href, just the type var h = Hash.createRandomHash(priv.app, priv.password); + data.fakeHref = true; data.href = base + priv.pathname + '#' + h; } else { waitFor.abort();