hacks to handle weird entries in drive

pull/1/head
ansuz 7 years ago
parent 2170fcb9ad
commit bd66c8fee8

@ -578,7 +578,7 @@ define([
}
var parsed = Hash.parsePadUrl(window.location.href);
if (!parsed.type || !parsed.hashData) { return void cb('E_INVALID_HREF'); }
if (parsed.type === 'file') { secret.channel = Util.base64ToHex(secret.channel); }
if (parsed.type === 'file' && typeof(parsed.channel) === 'string') { secret.channel = Util.base64ToHex(secret.channel); }
hashes = Hash.getHashes(secret);
if (secret.version === 0) {

@ -588,6 +588,7 @@ define([
if (!el.title) { el.title = Hash.getDefaultName(parsed); }
// Fix channel
if (!el.channel) {
try {
if (parsed.hashData && parsed.hashData.type === "file") {
// PASSWORD_FILES
el.channel = Util.base64ToHex(parsed.hashData.channel);
@ -596,6 +597,9 @@ define([
el.channel = secret.channel;
}
console.log('Adding missing channel in filesData ', el.channel);
} catch (e) {
console.error(e);
}
}
if ((loggedIn || config.testMode) && rootFiles.indexOf(id) === -1) {

Loading…
Cancel
Save