Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infinite onerror loop in avatar image loader #82

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Aug 12, 2024

  1. Fix infinite onerror loop in avatar image loader

    Avatar images have an onerror attribute to set their image to a generic avatar image if they fail to load from discord. However, in situations where the network fails or the discord CDN is unavailable for some reason (adblockers), this will throw an error as well.
    
    In browsers other than chrome, this will trigger the on-error handler again, infinitely looping requests as fast as possible. 
    
    We set the onerror handler to null before making the new request to get around this and ensure if the fallback fails to load we don't make further requests. 
    
    Signed-off-by: Bast <52266665+bast0006@users.noreply.github.com>
    bast0006 authored Aug 12, 2024
    Configuration menu
    Copy the full SHA
    bfa6b0b View commit details
    Browse the repository at this point in the history