Made image loading more reliable

This commit is contained in:
Eduard Urbach 2019-08-30 10:10:31 +09:00
parent 4976e5ab35
commit 2894a92af1
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0

View File

@ -908,6 +908,13 @@ export default class AnimeNotifier {
} }
element.onerror = () => { element.onerror = () => {
// Try loading from the origin server if our CDN failed
if(element.src.includes("media.notify.moe/")) {
console.warn(`CDN failed loading ${element.src}`)
element.src = element.src.replace("media.notify.moe/", "notify.moe/")
return
}
if(element.classList.contains("element-found")) { if(element.classList.contains("element-found")) {
return return
} }