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

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,
parent: props.parent,
}
console.info("Rendering attachment", attachProps);
switch (att.type) {
case AttachmentType.MESSAGES:
return <MessageReplyMessages {...attachProps} key={index}></MessageReplyMessages>

View File

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

View File

@@ -840,10 +840,13 @@ export function DialogProvider(props: DialogProviderProps) {
});
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({
id: meta.id,
blob: decrypted,
blob: blob,
type: meta.type,
preview: meta.preview
});