Ускоренная загрузка диалогов

This commit is contained in:
RoyceDa
2026-02-20 18:17:47 +02:00
parent 142082ba83
commit 9379bd656d
3 changed files with 7 additions and 2 deletions

View File

@@ -42,6 +42,7 @@ export function MessageAttachments(props: MessageAttachmentsProps) {
text: props.text, text: props.text,
parent: props.parent, parent: props.parent,
} }
console.info("Rendering attachment", attachProps);
switch (att.type) { switch (att.type) {
case AttachmentType.MESSAGES: case AttachmentType.MESSAGES:
return <MessageReplyMessages {...attachProps} key={index}></MessageReplyMessages> return <MessageReplyMessages {...attachProps} key={index}></MessageReplyMessages>

View File

@@ -29,6 +29,7 @@ export function MessageImage(props: AttachmentProps) {
const [blurhashPreview, setBlurhashPreview] = useState(""); const [blurhashPreview, setBlurhashPreview] = useState("");
useEffect(() => { useEffect(() => {
console.info("Consturcting image, download status: " + downloadStatus);
constructBlob(); constructBlob();
constructFromBlurhash(); constructFromBlurhash();
}, [downloadStatus]); }, [downloadStatus]);

View File

@@ -840,10 +840,13 @@ export function DialogProvider(props: DialogProviderProps) {
}); });
continue; continue;
} }
const decrypted = await decodeWithPassword(privatePlain, Buffer.from(fileData, 'binary').toString()); let blob = "";
if(meta.type != AttachmentType.IMAGE){
blob = await decodeWithPassword(privatePlain, Buffer.from(fileData, 'binary').toString());
}
attachments.push({ attachments.push({
id: meta.id, id: meta.id,
blob: decrypted, blob: blob,
type: meta.type, type: meta.type,
preview: meta.preview preview: meta.preview
}); });