Skip to content

Commit c8fad05

Browse files
committed
Update app-redirect.ts
1 parent 583d3a6 commit c8fad05

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/web/lib/middleware/utils/app-redirect.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ const APP_REDIRECTS = {
33
};
44

55
export const appRedirect = (path: string) => {
6-
if (path.endsWith("/settings/library") || path.endsWith("/settings/tags")) {
7-
return "/settings/library/tags";
6+
// Use a regex to match both "/settings/library" and "/settings/tags"
7+
const libraryTagsRegex = /\/settings\/(library|tags)$/;
8+
if (libraryTagsRegex.test(path)) {
9+
return path.replace(libraryTagsRegex, "/settings/library/tags");
810
} else if (APP_REDIRECTS[path]) {
911
return APP_REDIRECTS[path];
1012
}

0 commit comments

Comments
 (0)