mirror of
https://github.com/idanoo/autobrr
synced 2025-07-25 01:39:13 +00:00
enhancement(web): mutation improvements and toast updates (#913)
* make notification switch take onToggleMutation Instead of opening it like the edit button, it now enables/disables it directly. * improved toast for update checks * improved toast for download clients it now mentions what client is enabled/disabled * improved irc network toast * added toast when copying apikey * added toast to log download implemented an info variant for the toasts * improved feed toast * improved toast for update checks * Merge branch 'develop' into enhancement/mutation-improvements-toast-updates
This commit is contained in:
parent
96e38e649a
commit
8acf33589d
8 changed files with 68 additions and 20 deletions
|
@ -100,13 +100,10 @@ function ApplicationSettings() {
|
|||
}
|
||||
});
|
||||
|
||||
const toggleCheckUpdateMutation = useMutation({
|
||||
mutationFn: (value: boolean) => APIClient.config.update({ check_for_updates: value }),
|
||||
onSuccess: () => {
|
||||
toast.custom((t) => <Toast type="success" body={"Config successfully updated!"} t={t}/>);
|
||||
|
||||
const toggleCheckUpdateMutation = useMutation((value: boolean) => APIClient.config.update({ check_for_updates: value }).then(() => value), {
|
||||
onSuccess: (value: boolean) => {
|
||||
toast.custom(t => <Toast type="success" body={`${value ? "You will now be notified of new updates." : "You will no longer be notified of new updates."}`} t={t} />);
|
||||
queryClient.invalidateQueries({ queryKey: ["config"] });
|
||||
|
||||
checkUpdateMutation.mutate();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue