Fix old hashes not working anymore in pad
This commit is contained in:
@@ -214,6 +214,10 @@ Version 1
|
|||||||
|
|
||||||
Hash.getHashes = function (channel, secret) {
|
Hash.getHashes = function (channel, secret) {
|
||||||
var hashes = {};
|
var hashes = {};
|
||||||
|
if (!secret.keys) {
|
||||||
|
console.error('e');
|
||||||
|
return hashes;
|
||||||
|
}
|
||||||
if (secret.keys.editKeyStr) {
|
if (secret.keys.editKeyStr) {
|
||||||
hashes.editHash = getEditHashFromKeys(channel, secret.keys);
|
hashes.editHash = getEditHashFromKeys(channel, secret.keys);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1851,6 +1851,11 @@ define([
|
|||||||
if (!parsed.type || !parsed.hashData) { return void cb('E_INVALID_HREF'); }
|
if (!parsed.type || !parsed.hashData) { return void cb('E_INVALID_HREF'); }
|
||||||
var hashes = common.getHashes(secret.channel, secret);
|
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
|
// If we have a stronger version in drive, add it and add a redirect button
|
||||||
var stronger = recent && common.findStronger(null, recent);
|
var stronger = recent && common.findStronger(null, recent);
|
||||||
if (stronger) {
|
if (stronger) {
|
||||||
|
|||||||
Reference in New Issue
Block a user