fix(frontend): call mutate after changing public settings (#1302)

pull/1307/head
TheCatLady 4 years ago committed by GitHub
parent bec1d3dde8
commit c8f67cf866
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,7 +3,7 @@ import { Field, Form, Formik } from 'formik';
import React, { useMemo } from 'react';
import { defineMessages, useIntl } from 'react-intl';
import { useToasts } from 'react-toast-notifications';
import useSWR from 'swr';
import useSWR, { mutate } from 'swr';
import * as Yup from 'yup';
import type { Language, MainSettings } from '../../../server/lib/settings';
import { Permission, useUser } from '../../hooks/useUser';
@ -162,6 +162,7 @@ const SettingsMain: React.FC = () => {
trustProxy: values.trustProxy,
cacheImages: values.cacheImages,
});
mutate('/api/v1/settings/public');
addToast(intl.formatMessage(messages.toastSettingsSuccess), {
autoDismiss: true,

@ -1,7 +1,7 @@
import axios from 'axios';
import React, { useState } from 'react';
import { defineMessages, useIntl } from 'react-intl';
import useSWR from 'swr';
import useSWR, { mutate } from 'swr';
import type {
RadarrSettings,
SonarrSettings,
@ -213,6 +213,7 @@ const SettingsServices: React.FC = () => {
setDeleteServerModal({ open: false, serverId: null, type: 'radarr' });
revalidateRadarr();
revalidateSonarr();
mutate('/api/v1/settings/public');
};
return (
@ -237,6 +238,7 @@ const SettingsServices: React.FC = () => {
onClose={() => setEditRadarrModal({ open: false, radarr: null })}
onSave={() => {
revalidateRadarr();
mutate('/api/v1/settings/public');
setEditRadarrModal({ open: false, radarr: null });
}}
/>
@ -247,6 +249,7 @@ const SettingsServices: React.FC = () => {
onClose={() => setEditSonarrModal({ open: false, sonarr: null })}
onSave={() => {
revalidateSonarr();
mutate('/api/v1/settings/public');
setEditSonarrModal({ open: false, sonarr: null });
}}
/>

Loading…
Cancel
Save