Оптимизация ядра, исправление гонки потоков при получении версии

This commit is contained in:
RoyceDa
2026-02-20 16:34:54 +02:00
parent f01ed34285
commit 2e18d489be
17 changed files with 196 additions and 101 deletions

View File

@@ -6,6 +6,7 @@ import { IconArrowDown, IconFile, IconX } from "@tabler/icons-react";
import { dotCenterIfNeeded, humanFilesize } from "@/app/utils/utils";
import { AnimatedRoundedProgress } from "../AnimatedRoundedProgress/AnimatedRoundedProgress";
import { DeliveredMessageState } from "@/app/providers/DialogProvider/DialogProvider";
import { useCore } from "@/app/hooks/useCore";
export function MessageFile(props : AttachmentProps) {
const colors = useRosettaColors();
@@ -27,15 +28,15 @@ export function MessageFile(props : AttachmentProps) {
const filetype = filename.split(".")[filename.split(".").length - 1];
const isEncrypting = props.delivered == DeliveredMessageState.WAITING && uploadedPercentage <= 0;
const isUploading = props.delivered == DeliveredMessageState.WAITING && uploadedPercentage > 0 && uploadedPercentage < 100;
const {getDownloadsPath} = useCore();
const onClick = async () => {
if(downloadStatus == DownloadStatus.ERROR){
return;
}
if(downloadStatus == DownloadStatus.DOWNLOADED){
//let content = await getBlob();
//let buffer = Buffer.from(content.split(",")[1], 'base64');
let pathInDownloads = window.downloadsPath + "/Rosetta Downloads/" + filename;
const downloadsPath = await getDownloadsPath();
let pathInDownloads = downloadsPath + "/Rosetta Downloads/" + filename;
//await writeFile(pathInDownloads, buffer, false);
window.shell.showItemInFolder(pathInDownloads);
return;