Skip to content

Commit 41c11fc

Browse files
committed
fix trying to double decrypt in case of navigation.instant
1 parent fbe88fd commit 41c11fc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

encryptcontent/decrypt-contents.tpl.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,14 @@ function base64url_decode(input) {
352352
if (html_item[0]) {
353353
for (let i = 0; i < html_item.length; i++) {
354354
// grab the cipher bundle if something exist
355-
let content = {% if webcrypto %}await {% endif %}decrypt_content_from_bundle(key, html_item[i].innerHTML);
356-
if (content !== false) {
357-
// success; display the decrypted content
358-
html_item[i].innerHTML = content;
359-
html_item[i].style.display = null;
360-
// any post processing on the decrypted content should be done here
355+
if (html_item[i].style.display == "none") {
356+
let content = {% if webcrypto %}await {% endif %}decrypt_content_from_bundle(key, html_item[i].innerHTML);
357+
if (content !== false) {
358+
// success; display the decrypted content
359+
html_item[i].innerHTML = content;
360+
html_item[i].style.display = null;
361+
// any post processing on the decrypted content should be done here
362+
}
361363
}
362364
}
363365
}

0 commit comments

Comments
 (0)