From 58bf77dff6cf12891d1f79166bd639dc6bd942bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Mon, 22 Jul 2024 00:13:02 +0200 Subject: [PATCH] Fix frontend config update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/actions/admin.ts | 2 +- src/features/ui/util/global-hotkeys.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actions/admin.ts b/src/actions/admin.ts index c2af75466..8017daa88 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -90,7 +90,7 @@ const fetchConfig = () => const updateConfig = (configs: Record[]) => (dispatch: AppDispatch, getState: () => RootState) => { dispatch({ type: ADMIN_CONFIG_UPDATE_REQUEST, configs }); - return api(getState)('/api/v1/pleroma/admin/config', { method: 'POST', body: JSON.stringify(configs) }) + return api(getState)('/api/v1/pleroma/admin/config', { method: 'POST', body: JSON.stringify({ configs }) }) .then(({ json: data }) => { dispatch({ type: ADMIN_CONFIG_UPDATE_SUCCESS, configs: data.configs, needsReboot: data.need_reboot }); }).catch(error => { diff --git a/src/features/ui/util/global-hotkeys.tsx b/src/features/ui/util/global-hotkeys.tsx index e2337a8fe..ab33151fa 100644 --- a/src/features/ui/util/global-hotkeys.tsx +++ b/src/features/ui/util/global-hotkeys.tsx @@ -68,7 +68,7 @@ const GlobalHotkeys: React.FC = ({ children, node }) => { const element = node.current.querySelector('input#search') as HTMLInputElement; - if (element) { + if (element?.checkVisibility()) { element.focus(); } else { history.push('/search');