Improve getStrongerHash to also look inside shared folders

This commit is contained in:
yflory
2019-10-08 17:54:52 +02:00
parent e0a1b8724b
commit 4e4d01a471
4 changed files with 28 additions and 43 deletions

View File

@@ -1200,6 +1200,11 @@ define([
if (!parsed.type || !parsed.hashData) { return void cb('E_INVALID_HREF'); }
hashes = Hash.getHashes(secret);
// If the current href is an edit one, return the existing hashes
var parsedHash = parsed.hashData;
if (!parsedHash || parsedHash.mode === 'edit') { return void cb(null, hashes); }
if (parsedHash.type !== 'pad') { return void cb(null, hashes); }
if (secret.version === 0) {
// It means we're using an old hash
hashes.editHash = window.location.hash.slice(1);
@@ -1212,9 +1217,7 @@ define([
}
postMessage("GET_STRONGER_HASH", {
href: window.location.href,
channel: secret.channel,
password: secret.password
channel: secret.channel
}, function (hash) {
if (hash) { hashes.editHash = hash; }
cb(null, hashes);