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:
@@ -2047,17 +2047,43 @@ export const useRemoveTempDLNAIP = () => GQL.useRemoveTempDlnaipMutation();
|
||||
export const mutateReloadScrapers = () =>
|
||||
client.mutate<GQL.ReloadScrapersMutation>({
|
||||
mutation: GQL.ReloadScrapersDocument,
|
||||
refetchQueries: [
|
||||
GQL.refetchListMovieScrapersQuery(),
|
||||
GQL.refetchListPerformerScrapersQuery(),
|
||||
GQL.refetchListSceneScrapersQuery(),
|
||||
],
|
||||
update(cache, result) {
|
||||
if (!result.data?.reloadScrapers) return;
|
||||
|
||||
evictQueries(cache, [
|
||||
GQL.ListMovieScrapersDocument,
|
||||
GQL.ListPerformerScrapersDocument,
|
||||
GQL.ListSceneScrapersDocument,
|
||||
]);
|
||||
},
|
||||
});
|
||||
|
||||
const pluginMutationImpactedQueries = [
|
||||
GQL.PluginsDocument,
|
||||
GQL.PluginTasksDocument,
|
||||
];
|
||||
|
||||
export const mutateReloadPlugins = () =>
|
||||
client.mutate<GQL.ReloadPluginsMutation>({
|
||||
mutation: GQL.ReloadPluginsDocument,
|
||||
refetchQueries: [GQL.refetchPluginsQuery(), GQL.refetchPluginTasksQuery()],
|
||||
update(cache, result) {
|
||||
if (!result.data?.reloadPlugins) return;
|
||||
|
||||
evictQueries(cache, pluginMutationImpactedQueries);
|
||||
},
|
||||
});
|
||||
|
||||
type BoolMap = { [key: string]: boolean };
|
||||
|
||||
export const mutateSetPluginsEnabled = (enabledMap: BoolMap) =>
|
||||
client.mutate<GQL.SetPluginsEnabledMutation>({
|
||||
mutation: GQL.SetPluginsEnabledDocument,
|
||||
variables: { enabledMap },
|
||||
update(cache, result) {
|
||||
if (!result.data?.setPluginsEnabled) return;
|
||||
|
||||
evictQueries(cache, pluginMutationImpactedQueries);
|
||||
},
|
||||
});
|
||||
|
||||
export const mutateStopJob = (jobID: string) =>
|
||||
@@ -2093,14 +2119,6 @@ export const mutateMigrate = (input: GQL.MigrateInput) =>
|
||||
},
|
||||
});
|
||||
|
||||
type BoolMap = { [key: string]: boolean };
|
||||
|
||||
export const mutateSetPluginsEnabled = (enabledMap: BoolMap) =>
|
||||
client.mutate<GQL.SetPluginsEnabledMutation>({
|
||||
mutation: GQL.SetPluginsEnabledDocument,
|
||||
variables: { enabledMap },
|
||||
});
|
||||
|
||||
/// Tasks
|
||||
|
||||
export const mutateMetadataScan = (input: GQL.ScanMetadataInput) =>
|
||||
|
||||
Reference in New Issue
Block a user