From 2829ffc60a99ab9e839ef1370481a8341c4e4973 Mon Sep 17 00:00:00 2001 From: Harshith Mohan Date: Wed, 1 Nov 2023 23:46:02 +0530 Subject: [PATCH] Remove update to dev button on ErrorBoundary for stable server --- src/components/ErrorBoundary.tsx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx index 356041a23..27b394c6c 100644 --- a/src/components/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary.tsx @@ -3,6 +3,7 @@ import { useDispatch } from 'react-redux'; import { useNavigate, useRouteError } from 'react-router-dom'; import Button from '@/components/Input/Button'; +import { useGetInitVersionQuery } from '@/core/rtkQuery/splitV3Api/initApi'; import { usePostWebuiUpdateMutation } from '@/core/rtkQuery/splitV3Api/webuiApi'; import { unsetDetails } from '@/core/slices/apiSession'; @@ -11,6 +12,7 @@ const ErrorBoundary = () => { const navigate = useNavigate(); const error = useRouteError() as Error; // There is no type definition provided. + const version = useGetInitVersionQuery(); const [webuiUpdateTrigger, webuiUpdateResult] = usePostWebuiUpdateMutation(); const [updateChannel, setUpdateChannel] = useState<'Stable' | 'Dev'>('Stable'); @@ -68,14 +70,16 @@ const ErrorBoundary = () => { Force update to Stable Web UI - + {version.data?.Server.ReleaseChannel !== 'Stable' && ( + + )}