From f138148d2e44df6c3d30cc3c988d857565d6187e Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 26 Oct 2024 05:39:45 +0530 Subject: [PATCH] feat: fetch proxy config on load --- src/components/organisms/ProxyForm.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/organisms/ProxyForm.tsx b/src/components/organisms/ProxyForm.tsx index 17c8e04c..d58afedb 100644 --- a/src/components/organisms/ProxyForm.tsx +++ b/src/components/organisms/ProxyForm.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import { styled } from '@mui/system'; import { TextField, Button, Switch, FormControlLabel, Box, Typography, Tabs, Tab } from '@mui/material'; import { sendProxyConfig, getProxyConfig, testProxyConfig } from '../../api/proxy'; @@ -109,7 +109,12 @@ const ProxyForm: React.FC = () => { }); }; + useEffect(() => { + fetchProxyConfig(); + }, []); + return ( + <> Proxy Configuration @@ -193,6 +198,7 @@ const ProxyForm: React.FC = () => { )} + ); };