From 58ec74bb6868495eb747d44de1d8f1db7fbaccef Mon Sep 17 00:00:00 2001 From: WalkxCode Date: Sun, 12 Jun 2022 16:34:24 +0200 Subject: [PATCH] :children_crossing: Improves case matching for auto-fill --- src/components/AppShelf/AddAppShelfItem.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/AppShelf/AddAppShelfItem.tsx b/src/components/AppShelf/AddAppShelfItem.tsx index 93bb83c79..37a783303 100644 --- a/src/components/AppShelf/AddAppShelfItem.tsx +++ b/src/components/AppShelf/AddAppShelfItem.tsx @@ -65,7 +65,7 @@ function MatchIcon(name: string, form: any) { } function MatchService(name: string, form: any) { - const service = ServiceTypeList.find((s) => s === name); + const service = ServiceTypeList.find((s) => s.toLowerCase() === name.toLowerCase()); if (service) { form.setFieldValue('type', service); } @@ -73,16 +73,16 @@ function MatchService(name: string, form: any) { function MatchPort(name: string, form: any) { const portmap = [ - { name: 'qBittorrent', value: '8080' }, - { name: 'Sonarr', value: '8989' }, - { name: 'Radarr', value: '7878' }, - { name: 'Lidarr', value: '8686' }, - { name: 'Readarr', value: '8686' }, - { name: 'Deluge', value: '8112' }, - { name: 'Transmission', value: '9091' }, + { name: 'qbittorrent', value: '8080' }, + { name: 'sonarr', value: '8989' }, + { name: 'radarr', value: '7878' }, + { name: 'lidarr', value: '8686' }, + { name: 'readarr', value: '8686' }, + { name: 'deluge', value: '8112' }, + { name: 'transmission', value: '9091' }, ]; // Match name with portmap key - const port = portmap.find((p) => p.name === name); + const port = portmap.find((p) => p.name === name.toLowerCase()); if (port) { form.setFieldValue('url', `http://localhost:${port.value}`); }