fix: redirect to boards list after archiving/unarchiving a board (#459)
Previously, archiving or unarchiving a board left the user on the (now archived/unarchived) board view with no clear navigation path. This redirects to /boards after either action, matching the existing behaviour of delete and move operations. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import { useRouter } from "next/router";
|
||||||
import { t } from "@lingui/core/macro";
|
import { t } from "@lingui/core/macro";
|
||||||
import {
|
import {
|
||||||
HiEllipsisHorizontal,
|
HiEllipsisHorizontal,
|
||||||
@@ -29,6 +30,7 @@ export default function BoardDropdown({
|
|||||||
isFavorite?: boolean;
|
isFavorite?: boolean;
|
||||||
boardName?: string;
|
boardName?: string;
|
||||||
}) {
|
}) {
|
||||||
|
const router = useRouter();
|
||||||
const { openModal } = useModal();
|
const { openModal } = useModal();
|
||||||
const { showPopup } = usePopup();
|
const { showPopup } = usePopup();
|
||||||
const { canEditBoard, canDeleteBoard, canCreateBoard, canArchiveBoard } =
|
const { canEditBoard, canDeleteBoard, canCreateBoard, canArchiveBoard } =
|
||||||
@@ -47,6 +49,7 @@ export default function BoardDropdown({
|
|||||||
: t`The board has been unarchived.`,
|
: t`The board has been unarchived.`,
|
||||||
icon: "success",
|
icon: "success",
|
||||||
});
|
});
|
||||||
|
void router.push(`/boards`);
|
||||||
} else if (variables.favorite !== undefined) {
|
} else if (variables.favorite !== undefined) {
|
||||||
showPopup({
|
showPopup({
|
||||||
header: variables.favorite
|
header: variables.favorite
|
||||||
|
|||||||
Reference in New Issue
Block a user