XF 2.2 js help: updating after upload

cmpe

Active member
Been studying how uploads are handled for avatars so I can implement my own image uploading mechanism for my custom entity. I think I've got all the backend code working but now getting stuck with the frontend/javascript part where after an upload is processed and image is on disk, I need to use JS to re-fetch the image.

So now I followed the JS crumbs to get to this function call and am stuck:
JavaScript:
XF.updateAvatars(data.userId, data.avatars, useCustom);

So I see that this function is part of xf/core.js and looking for some tips in case there's a simpler way to do this cause this looks more complicated than I understand right now.

Thanks!
 
I actually found this in profile_banner.js and it looks simpler than the updateAvatars function but I am not exactly sure how this works? 😅
JavaScript:
$thisBanner.trigger('profile-banner:refresh');
 
Top Bottom