-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
adding in user icon in the desktop notifications #730
Conversation
@soonahn awesome, this works synchronously? |
Seems that it isn't, if avatar (initials) not was loaded before the notification the notification has no image. |
Synconous on the client side. Feature of html5 and canvas to transform image to png. Does require building a canvas element, but doesn't attach to the DOM |
Well yes, it's using the same method to get the avatar as everything else is. Is this an issue? |
No, you didn't understand, if the image isn't in browser cache you are rendering an empty image because render is sync but the code doesn't stop while the image is loaded from server. |
Steps to reproduce:
|
Ahh, now I understand. What is the right solution? Grab the user's initials avatar, load it into the browser cache, then send the notification? Seems weird to delay the notification, I would rather have a notification without an image, than a notification that came at the wrong time. |
What about something like:
Not much of a delay.. also I haven't tested this. But i'd think that'd insure the image was there before running through the canvas. Especially since avatarUrlFromUsername just returns a url:
|
@geekgonecrazy good ideia 😄 |
@geekgonecrazy good idea, I'll look at it again tonight. Thanks guys! |
@soonahn let me know if you need help with this. |
Am just busy with work. Weekdays are hard for me, I'll get it done this weekend, unless someone wants to take this branch over. |
It's fine @soonahn we appreciate all the help we can get. :) |
Address #729