deep-chat
deep-chat copied to clipboard
Allow avatar img fallback
If the provided image is broken the avatar div shows the alt text (expected), this suggestion is to add a fallback in case of errors avoiding the following result:
One solution is to add an error handler on the img element here: https://github.com/OvidijusParsiunas/deep-chat/blob/eb7df5c0eab8e97ea029541273c329e2c28046a6/component/src/views/chat/messages/avatar.ts#L34
If the provided image fails to load the default avatarUrl is then set.
Hey @arielmoraes. That is an interesting feature. I will add it later this weekend as I am a little busy tomorrow. Thanks!
Hey @arielmoraes.
I have added avatar fallback in deep-chat-dev and deep-chat-react-dev versions 9.0.230.
These packages work exactly the same as the core ones except their names are different.
I will keep this issue open until this feature is merged into the core packages. Thanks!
This is now available in deep-chat and deep-chat-react version 2.2.0.