fix(config-ui): connection initial values not work (#4222)
diff --git a/config-ui/src/pages/connection/form/index.tsx b/config-ui/src/pages/connection/form/index.tsx
index 297bfd0..66ace00 100644
--- a/config-ui/src/pages/connection/form/index.tsx
+++ b/config-ui/src/pages/connection/form/index.tsx
@@ -18,7 +18,7 @@
import React, { useState, useEffect, useMemo } from 'react';
import { useParams, useHistory } from 'react-router-dom';
-import { pick } from 'lodash';
+import { omit, pick } from 'lodash';
import { FormGroup, InputGroup, Switch, ButtonGroup, Button, Icon, Intent, Position } from '@blueprintjs/core';
import { Tooltip2 } from '@blueprintjs/popover2';
@@ -46,6 +46,7 @@
setForm({
...form,
...(connection ?? {}),
+ ...(omit(initialValues, 'rateLimitPerHour') ?? {}),
});
}, [initialValues, connection]);
@@ -104,7 +105,7 @@
{type === 'switch' && (
<S.SwitchWrapper>
<Switch
- checked={form[key] ?? initialValues?.[key] ?? false}
+ checked={form[key] ?? false}
onChange={(e) =>
setForm({
...form,