fix: make sure to only decode thumbhash once
This commit is contained in:
@@ -229,8 +229,9 @@ function rgbaToDataURL(w, h, rgba) {
|
|||||||
function updateThumbhashImages() {
|
function updateThumbhashImages() {
|
||||||
document.querySelectorAll("[data-thumb]").forEach((entry) => {
|
document.querySelectorAll("[data-thumb]").forEach((entry) => {
|
||||||
const hash = entry.getAttribute("data-thumb");
|
const hash = entry.getAttribute("data-thumb");
|
||||||
|
if (entry.getAttribute("data-thumb-decoded")) return;
|
||||||
if (!hash) return;
|
if (!hash) return;
|
||||||
|
entry.setAttribute("data-thumb-decoded", true);
|
||||||
|
|
||||||
const decodedString = atob(hash);
|
const decodedString = atob(hash);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user