From 36550b781f6fc0261b304f281f5820c554d321db Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 26 Jan 2018 15:44:34 +0100 Subject: [PATCH] Don't check for stronger hash if we have an edit hash --- www/common/common-hash.js | 2 ++ www/common/cryptpad-common.js | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/www/common/common-hash.js b/www/common/common-hash.js index d62204ac4..2ebe18331 100644 --- a/www/common/common-hash.js +++ b/www/common/common-hash.js @@ -300,6 +300,8 @@ Version 1 var rHref = href || getRelativeHref(window.location.href); var parsed = parsePadUrl(rHref); if (!parsed.hash) { return false; } + // We can't have a stronger hash if we're already in edit mode + if (parsed.hashData && parsed.hashData.mode === 'edit') { return; } var stronger; Object.keys(recents).some(function (id) { var pad = recents[id]; diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 214939072..ad5141c03 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -557,6 +557,11 @@ define([ return void cb(null, hashes); } + if (hashes.editHash) { + // no need to find stronger if we already have edit hash + return void cb(null, hashes); + } + postMessage("GET_STRONGER_HASH", { href: window.location.href }, function (hash) {