diff --git a/app/components/UpdateAlert/UpdateAlert.tsx b/app/components/UpdateAlert/UpdateAlert.tsx
index 56e2e05..6f90f1b 100644
--- a/app/components/UpdateAlert/UpdateAlert.tsx
+++ b/app/components/UpdateAlert/UpdateAlert.tsx
@@ -1,44 +1,50 @@
import { Button, MantineRadius } from "@mantine/core";
import { IconRefresh } from "@tabler/icons-react";
import { AnimatedRoundedProgress } from "../AnimatedRoundedProgress/AnimatedRoundedProgress";
-import { UpdateStatus, useUpdater } from "@/app/hooks/useUpdater";
+import { useUpdater } from "@/app/providers/UpdateProvider/useUpdater";
+import { UpdateStatus } from "@/app/providers/UpdateProvider/UpdateProvider";
+import { useEffect } from "react";
interface UpdateAlertProps {
radius?: MantineRadius;
}
+/**
+ * Компонент для отображения кнопки обновлений если оно доступно, и прогресса загрузки если обновление уже скачивается
+ */
export function UpdateAlert(props : UpdateAlertProps) {
const radius = props.radius || 0;
const {
- appUpdateUrl,
kernelUpdateUrl,
downloadProgress,
updateStatus,
- kernelOutdatedForNextAppUpdates,
downloadLastApplicationUpdate,
restartAppForUpdateApply,
+ checkForUpdates
} = useUpdater();
+ useEffect(() => {
+ checkForUpdates();
+ }, []);
+
return (
<>
- {updateStatus == UpdateStatus.IDLE && <>
- {kernelOutdatedForNextAppUpdates && <>
-
- >}
- {!kernelOutdatedForNextAppUpdates && appUpdateUrl != "" && <>
-
- >}
+ {updateStatus == UpdateStatus.KERNEL_UPDATE_NEED && <>
+
+ >}
+ {updateStatus == UpdateStatus.APP_UPDATE_AVAILABLE && <>
+
>}
{updateStatus == UpdateStatus.DOWNLOADING && <>