Оптимизация ядра, исправление гонки потоков при получении версии
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user