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

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

@@ -10,11 +10,14 @@ import { AnimatedButton } from "@/app/components/AnimatedButton/AnimatedButton";
import { useLogout } from "@/app/providers/AccountProvider/useLogout";
import { usePacket } from "@/app/providers/ProtocolProvider/usePacket";
import { PacketDeviceResolve, Solution } from "@/app/providers/ProtocolProvider/protocol/packets/packet.device.resolve";
import { useCoreDevice } from "@/app/providers/DeviceProvider/useCoreDevice";
export function DeviceConfirm() {
const [protocolState] = useProtocolState();
const navigate = useNavigate();
const logout = useLogout();
const {deviceName} = useCoreDevice();
useEffect(() => {
if(protocolState == ProtocolState.CONNECTED) {
@@ -60,7 +63,7 @@ export function DeviceConfirm() {
<Flex justify={'center'} mt={'xl'} px={'lg'} align={'center'}>
<Flex justify={'center'} gap={'sm'} align={'center'}>
<Text ta={'center'} c={'dimmed'} fz={12}>
Confirm device <strong>{window.deviceName}</strong> on your first device to loading your chats.
Confirm device <strong>{deviceName}</strong> on your first device to loading your chats.
</Text>
</Flex>
</Flex>

View File

@@ -4,15 +4,26 @@ import { RosettaPower } from "@/app/components/RosettaPower/RosettaPower";
import { SettingsAlert } from "@/app/components/SettingsAlert/SettingsAlert";
import { SettingsInput } from "@/app/components/SettingsInput/SettingsInput";
import { UpdateAlert } from "@/app/components/UpdateAlert/UpdateAlert";
import { CORE_VERSION } from "@/app/constants";
import { useCore } from "@/app/hooks/useCore";
import { UpdateStatus } from "@/app/providers/UpdateProvider/UpdateProvider";
import { useUpdater } from "@/app/providers/UpdateProvider/useUpdater";
import { APP_VERSION } from "@/app/version";
import { Box, Text } from "@mantine/core";
import { useEffect, useState } from "react";
export function Update() {
const {updateStatus} = useUpdater();
const {getCoreVersion} = useCore();
const [coreVersion, setCoreVersion] = useState<string>("");
useEffect(() => {
const fetchCoreVersion = async () => {
const version = await getCoreVersion();
setCoreVersion(version);
}
fetchCoreVersion();
}, [getCoreVersion]);
return (
<>
<Breadcrumbs text="Updates"></Breadcrumbs>
@@ -23,7 +34,7 @@ export function Update() {
<Box mt={'sm'}>
<UpdateAlert radius={'sm'}></UpdateAlert>
</Box>
<SettingsInput.Copy mt={'sm'} hit="Kernel" value={CORE_VERSION}></SettingsInput.Copy>
<SettingsInput.Copy mt={'sm'} hit="Kernel" value={coreVersion}></SettingsInput.Copy>
<Text fz={10} mt={3} c={'gray'} pl={'xs'} pr={'xs'}>
If the kernel version is outdated, you need to reinstall the application so that this kernel continues to receive current updates.
</Text>