fix: empty indexer name on setup (#48)

This commit is contained in:
Ludvig Lundgren 2021-12-24 00:37:51 +01:00 committed by GitHub
parent 9b4ea21885
commit 709599104b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,9 +79,6 @@ export function IndexerAddForm({ isOpen, toggle }: AddProps) {
channels: channels, channels: channels,
} }
// console.log("network: ", network);
// console.log("formData: ", formData);
mutation.mutate(formData, { mutation.mutate(formData, {
onSuccess: (data) => { onSuccess: (data) => {
// create irc // create irc
@ -176,6 +173,7 @@ export function IndexerAddForm({ isOpen, toggle }: AddProps) {
initialValues={{ initialValues={{
enabled: true, enabled: true,
identifier: "", identifier: "",
name: "",
irc: {}, irc: {},
settings: {}, settings: {},
}} }}
@ -229,6 +227,7 @@ export function IndexerAddForm({ isOpen, toggle }: AddProps) {
placeholder="Choose an indexer" placeholder="Choose an indexer"
value={field?.value && field.value.value} value={field?.value && field.value.value}
onChange={(option: any) => { onChange={(option: any) => {
setFieldValue("name", option?.label ?? "")
setFieldValue(field.name, option?.value ?? "") setFieldValue(field.name, option?.value ?? "")
}} }}
options={data && data.sort((a, b): any => a.name.localeCompare(b.name)).map(v => ({ options={data && data.sort((a, b): any => a.name.localeCompare(b.name)).map(v => ({