feat: показывать версию приложения в настройках, версия 1.1.0

Версии бэкенда и фронтенда были не синхронизированы и нигде не отображались
в интерфейсе — непонятно было, обновилось ли приложение после пересборки.
Теперь единая версия 1.1.0 приходит с бэкенда через /api/health и мелким
текстом выводится внизу страницы настроек.
This commit is contained in:
ZProger
2026-09-02 02:21:05 +03:00
parent c422fd1528
commit 946b78d989
8 changed files with 42 additions and 5 deletions

View File

@@ -0,0 +1,8 @@
import { useQuery } from "@tanstack/react-query";
import { fetchHealth } from "@/api/health";
// The running version only changes on a deploy (a full page reload), so
// there's no need to ever refetch within a session.
export function useHealth() {
return useQuery({ queryKey: ["health"], queryFn: fetchHealth, staleTime: Infinity });
}