Обновление протокола вложений
This commit is contained in:
@@ -30,7 +30,7 @@ export function useAttachment(attachment: Attachment, parentMessage: MessageProp
|
||||
const uploadedPercentage = useUploadStatus(attachment.id);
|
||||
const downloadPercentage = useDownloadStatus(attachment.id);
|
||||
const [downloadStatus, setDownloadStatus] = useMemory("attachment-downloaded-status-" + attachment.id, DownloadStatus.PENDING, true);
|
||||
const [downloadTag, setDownloadTag] = useState(attachment.transport_tag || "");
|
||||
const [downloadTag, setDownloadTag] = useState(attachment.transport.transport_tag || "");
|
||||
const {readFile, writeFile, fileExists, size} = useFileStorage();
|
||||
const { downloadFile } = useTransport();
|
||||
const publicKey = usePublicKey();
|
||||
@@ -56,7 +56,7 @@ export function useAttachment(attachment: Attachment, parentMessage: MessageProp
|
||||
if (downloadStatus == DownloadStatus.DOWNLOADED) {
|
||||
return;
|
||||
}
|
||||
if(attachment.transport_tag == ""){
|
||||
if(attachment.transport.transport_tag == ""){
|
||||
/**
|
||||
* Транспортного тега нет только у сообщений отправленных нами, значит он точно наш
|
||||
*/
|
||||
@@ -130,7 +130,7 @@ export function useAttachment(attachment: Attachment, parentMessage: MessageProp
|
||||
let downloadedBlob = '';
|
||||
try {
|
||||
downloadedBlob = await downloadFile(attachment.id,
|
||||
downloadTag, attachment.transport_server);
|
||||
downloadTag, attachment.transport.transport_server);
|
||||
} catch (e) {
|
||||
console.info(e);
|
||||
info("Error downloading attachment: " + attachment.id);
|
||||
|
||||
Reference in New Issue
Block a user