mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Minor UI tweaks (#4297)
* Don't render PluginTasks if no tasks available * Improve query refetching
This commit is contained in:
@@ -75,14 +75,18 @@ export const SettingsPluginsPanel: React.FC = () => {
|
||||
const intl = useIntl();
|
||||
|
||||
const { loading: configLoading, plugins, savePluginSettings } = useSettings();
|
||||
const { data, loading, refetch } = usePlugins();
|
||||
const { data, loading } = usePlugins();
|
||||
|
||||
const [changedPluginID, setChangedPluginID] = React.useState<
|
||||
string | undefined
|
||||
>();
|
||||
|
||||
async function onReloadPlugins() {
|
||||
await mutateReloadPlugins().catch((e) => Toast.error(e));
|
||||
try {
|
||||
await mutateReloadPlugins();
|
||||
} catch (e) {
|
||||
Toast.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
const pluginElements = useMemo(() => {
|
||||
@@ -105,12 +109,13 @@ export const SettingsPluginsPanel: React.FC = () => {
|
||||
|
||||
function renderEnableButton(pluginID: string, enabled: boolean) {
|
||||
async function onClick() {
|
||||
await mutateSetPluginsEnabled({ [pluginID]: !enabled }).catch((e) =>
|
||||
Toast.error(e)
|
||||
);
|
||||
try {
|
||||
await mutateSetPluginsEnabled({ [pluginID]: !enabled });
|
||||
} catch (e) {
|
||||
Toast.error(e);
|
||||
}
|
||||
|
||||
setChangedPluginID(pluginID);
|
||||
refetch();
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -229,7 +234,6 @@ export const SettingsPluginsPanel: React.FC = () => {
|
||||
intl,
|
||||
Toast,
|
||||
changedPluginID,
|
||||
refetch,
|
||||
plugins,
|
||||
savePluginSettings,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user