diff --git a/web/src/pages/ConfigureBot/ConfigurationContext.tsx b/web/src/pages/ConfigureBot/ConfigurationContext.tsx index 25218dc..b7e6db3 100644 --- a/web/src/pages/ConfigureBot/ConfigurationContext.tsx +++ b/web/src/pages/ConfigureBot/ConfigurationContext.tsx @@ -25,9 +25,9 @@ export const ConfigurationContextProvider: React.FC = () => { const bot = useGetSelectedBot() const { data: botConfigFromServer, isLoading } = useQuery({ - enabled: bot?.socketId !== undefined, - queryKey: ['botConfig'], - queryFn: () => axios.get(`/api/get_bot_config/${bot?.socketId}`).then((response) => response.data), + enabled: selectedSocketId !== undefined, + queryKey: ['botConfig', selectedSocketId], + queryFn: () => axios.get(`/api/get_bot_config/${selectedSocketId}`).then((response) => response.data), }) useEffect(() => {