geno7 / Rarebit

a template for webcomic hosting intended for use with NeoCities, but it can be used virtually anywhere. created to be as user-friendly and feature-rich as possible while staying vanilla.
GNU General Public License v3.0
44 stars 2 forks source link

Having no default image causes infinite loop #5

Open scvnc opened 1 year ago

scvnc commented 1 year ago

Hey-- I was helping someone use Rarebit for their neocities/webcomic. They wound up into an infinite loop complaining that the site was being janky.

I suspect it may be this line, where the error handler changes the img src, but if default.png hasn't been uploaded then it goes into an infinite loop.

cellThumb.innerHTML = `<img alt="${pgTitle}" title="${pgTitle}" src="${pgThumb}" onerror="javascript:this.src='${pgThumbDefault}'"/>`;

Chome dev console: image

Replacing it with a handler that detects this loop (if it errored on pgThumbDefault, dont bother setting the src again) may be the useful enhancement. Perhaps a useful console.error directing the artist to upload a pgThumbDefault.

Btw, awesome wario video-- I coincidentially found that a day before this bug.