#2245 Fix custom group avatar display

This commit is contained in:
Cohee 2024-05-16 00:49:26 +03:00
parent ccfd3606dc
commit 7fbed26c26
1 changed files with 5 additions and 1 deletions

View File

@ -637,7 +637,7 @@ function isValidImageUrl(url) {
if (Object.keys(url).length === 0) {
return false;
}
return isDataURL(url) || (url && url.startsWith('user'));
return isDataURL(url) || (url && (url.startsWith('user') || url.startsWith('/user')));
}
function getGroupAvatar(group) {
@ -1418,6 +1418,10 @@ function select_group_chats(groupId, skipAnimation) {
* @returns {Promise<void>} - A promise that resolves when the processing and upload is complete.
*/
async function uploadGroupAvatar(event) {
if (!(event.target instanceof HTMLInputElement) || !event.target.files.length) {
return;
}
const file = event.target.files[0];
if (!file) {