Skip to content

Commit

Permalink
Fix redirect after deleting deck in home group
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian702 committed Feb 5, 2024
1 parent d671da5 commit 5508250
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/components/navigation/Tabs/DeckSettingsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ export const DeckSettingsTab = ({
const response = await deleteRequest(`/api/decks/${deck.deckID}`);
if (response?.ok) {
toast.info(t`Deck deleted!`, { toastId: "deletedDeckToast" });
mutate(`/api/groups/${group.groupID}/decks`);
router.push(group.isDefault ? "/" : `/group/${group.groupID}`);
} else {
toast.error("Error!", { toastId: "deletedDeckToast" });
}
mutate(`/api/groups/${group.groupID}/decks`);
router.push(`/group/${group.groupID}`);
}
};

0 comments on commit 5508250

Please sign in to comment.