Оптимизация ядра, исправление гонки потоков при получении версии
This commit is contained in:
@@ -7,14 +7,16 @@ import { useHotkeys } from "@mantine/hooks";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { usePublicKey } from "@/app/providers/AccountProvider/usePublicKey";
|
||||
import { DialogHeaderText } from "../DialogHeaderText/DialogHeaderText";
|
||||
import { useCoreDevice } from "@/app/providers/DeviceProvider/useCoreDevice";
|
||||
|
||||
export function DialogsPanelHeader() {
|
||||
const colors = useRosettaColors();
|
||||
const logout = useLogout();
|
||||
const navigate = useNavigate();
|
||||
const publicKey = usePublicKey();
|
||||
const viewKeys = window.platform == 'darwin' ? '⌘' : 'Ctrl+';
|
||||
const triggerKeys = window.platform == 'darwin' ? 'mod' : 'Ctrl';
|
||||
const {platform} = useCoreDevice();
|
||||
const viewKeys = platform == 'darwin' ? '⌘' : 'Ctrl+';
|
||||
const triggerKeys = platform == 'darwin' ? 'mod' : 'Ctrl';
|
||||
|
||||
useHotkeys([
|
||||
[`${triggerKeys}+L`, () => logout()],
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -5,17 +5,19 @@ import { useProtocolState } from "@/app/providers/ProtocolProvider/useProtocolSt
|
||||
import { ProtocolState } from "@/app/providers/ProtocolProvider/ProtocolProvider";
|
||||
import { WindowsFrameButtons } from "../WindowsFrameButtons/WindowsFrameButtons";
|
||||
import { MacFrameButtons } from "../MacFrameButtons/MacFrameButtons";
|
||||
import { useCoreDevice } from "@/app/providers/DeviceProvider/useCoreDevice";
|
||||
|
||||
export function Topbar() {
|
||||
const colors = useRosettaColors();
|
||||
const [protocolState] = useProtocolState();
|
||||
const {platform} = useCoreDevice();
|
||||
|
||||
|
||||
return (
|
||||
<Box className={classes.drag} ta={'center'} p={3} bg={colors.mainColor}>
|
||||
{window.platform == 'win32' && <WindowsFrameButtons></WindowsFrameButtons>}
|
||||
{window.platform == 'darwin' && <MacFrameButtons></MacFrameButtons>}
|
||||
{window.platform == 'linux' && <WindowsFrameButtons></WindowsFrameButtons>}
|
||||
{platform == 'win32' && <WindowsFrameButtons></WindowsFrameButtons>}
|
||||
{platform == 'darwin' && <MacFrameButtons></MacFrameButtons>}
|
||||
{platform == 'linux' && <WindowsFrameButtons></WindowsFrameButtons>}
|
||||
{(protocolState == ProtocolState.CONNECTED || protocolState == ProtocolState.SYNCHRONIZATION || !window.location.hash.includes("main")) &&
|
||||
<Flex align={'center'} justify={'center'}>
|
||||
<Text fw={'bolder'} fz={13} c={'gray'}>
|
||||
|
||||
Reference in New Issue
Block a user