Просмотр исходного кода

Merge pull request #3905 from weseek/fix/not-delete-proxy-url

Fix/not delete proxy url
Sizma yosimaz 4 лет назад
Родитель
Сommit
bbdb40d3b0

+ 2 - 3
src/client/js/components/Admin/SlackIntegration/CustomBotWithProxySettings.jsx

@@ -20,10 +20,9 @@ const CustomBotWithProxySettings = (props) => {
   const [siteName, setSiteName] = useState('');
   const [siteName, setSiteName] = useState('');
   const { t } = useTranslation();
   const { t } = useTranslation();
 
 
+  // componentDidUpdate
   useEffect(() => {
   useEffect(() => {
-    if (proxyServerUri != null) {
-      setNewProxyServerUri(proxyServerUri);
-    }
+    setNewProxyServerUri(proxyServerUri);
   }, [proxyServerUri]);
   }, [proxyServerUri]);
 
 
   const addSlackAppIntegrationHandler = async() => {
   const addSlackAppIntegrationHandler = async() => {

+ 2 - 3
src/client/js/components/Admin/SlackIntegration/OfficialBotSettings.jsx

@@ -21,10 +21,9 @@ const OfficialBotSettings = (props) => {
 
 
   const [newProxyServerUri, setNewProxyServerUri] = useState();
   const [newProxyServerUri, setNewProxyServerUri] = useState();
 
 
+  // componentDidUpdate
   useEffect(() => {
   useEffect(() => {
-    if (proxyServerUri != null) {
-      setNewProxyServerUri(proxyServerUri);
-    }
+    setNewProxyServerUri(proxyServerUri);
   }, [proxyServerUri, slackAppIntegrations]);
   }, [proxyServerUri, slackAppIntegrations]);
 
 
   const addSlackAppIntegrationHandler = async() => {
   const addSlackAppIntegrationHandler = async() => {