Sync update: 2026-05-18 16:06:07
This commit is contained in:
@@ -59,9 +59,18 @@ function sendTo(ws, payload) {
|
|||||||
async function formatChat(chat) {
|
async function formatChat(chat) {
|
||||||
let avatar = null;
|
let avatar = null;
|
||||||
try {
|
try {
|
||||||
const contact = await chat.getContact();
|
// Ultra-fast memory-based avatar fetch with strict 300ms fallback to prevent hangs
|
||||||
const pic = await contact.getProfilePicUrl();
|
avatar = await Promise.race([
|
||||||
if (pic) avatar = pic;
|
chat.client.pupPage.evaluate((chatId) => {
|
||||||
|
try {
|
||||||
|
const contact = window.Store.Contact.get(chatId);
|
||||||
|
return contact && contact.profilePicThumb ? (contact.profilePicThumb.imgFull || contact.profilePicThumb.img) : null;
|
||||||
|
} catch (_) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}, chat.id._serialized),
|
||||||
|
new Promise(resolve => setTimeout(() => resolve(null), 300))
|
||||||
|
]);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
|
|
||||||
// Last Message formatting
|
// Last Message formatting
|
||||||
|
|||||||
Reference in New Issue
Block a user