Skip to content

Commit

Permalink
Fix: allow renaming after saving config
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithmohan committed Jan 26, 2025
1 parent 0150652 commit 2c3cdb1
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/pages/utilities/Renamer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,20 @@ const Renamer = () => {

const handleSaveConfig = useEventCallback(() => {
if (!newConfig || !renamer) return;
saveConfig({
RenamerID: renamer.RenamerID,
Name: selectedConfig.Name,
Settings: map(newConfig, config => config),
});
saveConfig(
{
RenamerID: renamer.RenamerID,
Name: selectedConfig.Name,
Settings: map(newConfig, config => config),
},
{
onSuccess: () => {
changeSelectedConfig(selectedConfig.Name);
toast.success(`"${selectedConfig.Name}" saved successfully!`);
},
onError: () => toast.error(`"${selectedConfig.Name}" could not be saved!`),
},
);
});

const handleDeleteConfig = useEventCallback(() => {
Expand Down

0 comments on commit 2c3cdb1

Please sign in to comment.