fix(indexers-irc): load new values on update (#274)

* fix(indexers-irc): reload config on restart

* fix(indexers-irc): reload config

* fix: indexer add form
This commit is contained in:
Ludvig Lundgren 2022-05-17 09:35:08 +02:00 committed by GitHub
parent 45053d9823
commit 2903e7b493
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 46 additions and 55 deletions

View file

@ -370,15 +370,18 @@ export function IndexerAddForm({ isOpen, toggle }: AddProps) {
})}
value={field?.value && field.value.value}
onChange={(option: unknown) => {
const opt = option as SelectValue;
resetForm();
const opt = option as SelectValue;
setFieldValue("name", opt.label ?? "");
setFieldValue(field.name, opt.value ?? "");
const ind = data && data.find(i => i.identifier === opt.value);
if (ind) {
setIndexer(ind);
if (ind.irc.settings) {
setFieldValue("implementation", ind.implementation);
if (ind.irc && ind.irc.settings) {
ind.irc.settings.forEach((s) => {
setFieldValue(`irc.${s.name}`, s.default ?? "");
});