Fix auto-generated keys not saving. Closes #2874

This commit is contained in:
Gabe Kangas
2023-03-27 21:34:39 -07:00
parent 5ddab41b4b
commit 2b19f9272e

View File

@@ -57,6 +57,7 @@ const AddKeyForm = ({ setShowAddKeyForm, setFieldInConfigState, streamKeys, setE
const [hasChanged, setHasChanged] = useState(true); const [hasChanged, setHasChanged] = useState(true);
const [form] = Form.useForm(); const [form] = Form.useForm();
const { Item } = Form; const { Item } = Form;
// Password Complexity rules // Password Complexity rules
const passwordComplexityRules = []; const passwordComplexityRules = [];
@@ -98,6 +99,7 @@ const AddKeyForm = ({ setShowAddKeyForm, setFieldInConfigState, streamKeys, setE
onFinish={handleAddKey} onFinish={handleAddKey}
form={form} form={form}
style={{ display: 'flex', flexDirection: 'row' }} style={{ display: 'flex', flexDirection: 'row' }}
initialValues={{ key: defaultKey, comment: 'My new key' }}
> >
<Item <Item
style={{ width: '60%', marginRight: '5px' }} style={{ width: '60%', marginRight: '5px' }}
@@ -112,7 +114,7 @@ const AddKeyForm = ({ setShowAddKeyForm, setFieldInConfigState, streamKeys, setE
} }
rules={PASSWORD_COMPLEXITY_RULES} rules={PASSWORD_COMPLEXITY_RULES}
> >
<Input placeholder="def456" defaultValue={defaultKey} onChange={handleInputChange} /> <Input placeholder="your key" onChange={handleInputChange} />
</Item> </Item>
<Item <Item
style={{ width: '60%', marginRight: '5px' }} style={{ width: '60%', marginRight: '5px' }}