Fix frontend config update

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-07-22 00:13:02 +02:00
parent 2136ea1257
commit 58bf77dff6
2 changed files with 2 additions and 2 deletions

View File

@ -90,7 +90,7 @@ const fetchConfig = () =>
const updateConfig = (configs: Record<string, any>[]) =>
(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 => {

View File

@ -68,7 +68,7 @@ const GlobalHotkeys: React.FC<IGlobalHotkeys> = ({ children, node }) => {
const element = node.current.querySelector('input#search') as HTMLInputElement;
if (element) {
if (element?.checkVisibility()) {
element.focus();
} else {
history.push('/search');