Ускоренная загрузка диалогов
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -29,6 +29,7 @@ export function MessageImage(props: AttachmentProps) {
|
||||
const [blurhashPreview, setBlurhashPreview] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
console.info("Consturcting image, download status: " + downloadStatus);
|
||||
constructBlob();
|
||||
constructFromBlurhash();
|
||||
}, [downloadStatus]);
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user