Fix old hashes not working anymore in pad

This commit is contained in:
yflory 2017-08-28 13:53:24 +02:00
parent e4a356d873
commit d9bf2abcd8
2 changed files with 9 additions and 0 deletions

View file

@ -214,6 +214,10 @@ Version 1
Hash.getHashes = function (channel, secret) {
var hashes = {};
if (!secret.keys) {
console.error('e');
return hashes;
}
if (secret.keys.editKeyStr) {
hashes.editHash = getEditHashFromKeys(channel, secret.keys);
}

View file

@ -1851,6 +1851,11 @@ define([
if (!parsed.type || !parsed.hashData) { return void cb('E_INVALID_HREF'); }
var hashes = common.getHashes(secret.channel, secret);
if (!hashes.editHash && !hashes.viewHash && parsed.hashData && !parsed.hashData.mode) {
// It means we're using an old hash
hashes.editHash = window.location.hash.slice(1);
}
// If we have a stronger version in drive, add it and add a redirect button
var stronger = recent && common.findStronger(null, recent);
if (stronger) {