From 9749d723fc0a282b291c06ee68a6e174dcec1c5b Mon Sep 17 00:00:00 2001 From: TheCatLady <52870424+TheCatLady@users.noreply.github.com> Date: Thu, 6 May 2021 20:03:45 -0400 Subject: [PATCH] fix(plex): sync libraries after saving settings (#1592) --- src/components/Settings/SettingsPlex.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/Settings/SettingsPlex.tsx b/src/components/Settings/SettingsPlex.tsx index 0130c23fd..801d882c7 100644 --- a/src/components/Settings/SettingsPlex.tsx +++ b/src/components/Settings/SettingsPlex.tsx @@ -311,7 +311,8 @@ const SettingsPlex: React.FC = ({ onComplete }) => { webAppUrl: values.webAppUrl, } as PlexSettings); - revalidate(); + syncLibraries(); + if (toastId) { removeToast(toastId); } @@ -319,6 +320,7 @@ const SettingsPlex: React.FC = ({ onComplete }) => { autoDismiss: true, appearance: 'success', }); + if (onComplete) { onComplete(); } @@ -339,7 +341,6 @@ const SettingsPlex: React.FC = ({ onComplete }) => { values, handleSubmit, setFieldValue, - setFieldTouched, isSubmitting, }) => { return ( @@ -359,14 +360,12 @@ const SettingsPlex: React.FC = ({ onComplete }) => { onChange={async (e) => { const targPreset = availablePresets[Number(e.target.value)]; + if (targPreset) { setFieldValue('hostname', targPreset.address); setFieldValue('port', targPreset.port); setFieldValue('useSsl', targPreset.ssl); } - setFieldTouched('hostname'); - setFieldTouched('port'); - setFieldTouched('useSsl'); }} >