We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 583d3a6 commit c8fad05Copy full SHA for c8fad05
apps/web/lib/middleware/utils/app-redirect.ts
@@ -3,8 +3,10 @@ const APP_REDIRECTS = {
3
};
4
5
export const appRedirect = (path: string) => {
6
- if (path.endsWith("/settings/library") || path.endsWith("/settings/tags")) {
7
- return "/settings/library/tags";
+ // Use a regex to match both "/settings/library" and "/settings/tags"
+ const libraryTagsRegex = /\/settings\/(library|tags)$/;
8
+ if (libraryTagsRegex.test(path)) {
9
+ return path.replace(libraryTagsRegex, "/settings/library/tags");
10
} else if (APP_REDIRECTS[path]) {
11
return APP_REDIRECTS[path];
12
}
0 commit comments