Ускоренная загрузка диалогов
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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]);
|
||||||
|
|||||||
@@ -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
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user