diff --git a/script/single.ts b/script/single.ts index 116c83e..21e6f8c 100644 --- a/script/single.ts +++ b/script/single.ts @@ -27,7 +27,8 @@ function setImage(id: string, src: string, href: string, cw: string): void { if (curCw && !coverNew) { // keep old cover until load - mainimg.addEventListener('load', () => openCW(null, curCw), {once: true}); + function removeCover() { setTimeout(() => openCW(null, curCw!), 100); } + mainimg.addEventListener('load', removeCover, {once: true}); } else if (coverNew) { // place new cover const newCw =