feat: implement mod queue

This commit is contained in:
plebeius
2026-01-07 16:03:02 +01:00
parent 5a072a0307
commit 70ba14591a
46 changed files with 1143 additions and 41 deletions
+29
View File
@@ -0,0 +1,29 @@
import {
isAllView,
isBoardView,
isCatalogView,
isHomeView,
isModView,
isModQueueView,
isPendingPostView,
isPostPageView,
isSettingsView,
isSubscriptionsView,
isNotFoundView,
ParamsType,
} from './view-utils';
export {
isAllView,
isBoardView,
isCatalogView,
isHomeView,
isModView,
isModQueueView,
isPendingPostView,
isPostPageView,
isSettingsView,
isSubscriptionsView,
isNotFoundView,
};
export type { ParamsType };
+10
View File
@@ -106,6 +106,7 @@ export const isFeedRoute = (pathname: string): boolean => {
if (normalizedPath.includes('/thread/')) return false;
if (normalizedPath.startsWith('/pending/')) return false;
if (normalizedPath.includes('/queue')) return false;
const pathWithoutSettings = normalizedPath.replace(/\/settings$/, '');
@@ -137,6 +138,11 @@ export const isPendingPostRoute = (pathname: string): boolean => {
return normalizedPath.startsWith('/pending/');
};
export const isModQueueRoute = (pathname: string): boolean => {
const normalizedPath = pathname.replace(/\/settings$/, '');
return normalizedPath.includes('/queue');
};
export const getFeedCacheKey = (pathname: string): string | null => {
let normalizedPath = pathname.endsWith('/') ? pathname.slice(0, -1) : pathname;
normalizedPath = normalizedPath.replace(/\/settings$/, '');
@@ -150,6 +156,10 @@ export const getFeedCacheKey = (pathname: string): string | null => {
return null;
}
if (normalizedPath.includes('/queue')) {
return null;
}
if (isFeedRoute(pathname)) {
return normalizedPath;
}
+6 -1
View File
@@ -59,6 +59,10 @@ export const isModView = (pathname: string): boolean => {
return pathname === `/mod` || pathname.startsWith(`/mod/`);
};
export const isModQueueView = (pathname: string): boolean => {
return pathname.includes('/queue');
};
export const isPendingPostView = (pathname: string, params: ParamsType): boolean => {
return pathname === `/pending/${params.accountCommentIndex}` || pathname === `/pending/${params.accountCommentIndex}/settings`;
};
@@ -101,6 +105,7 @@ export const isNotFoundView = (pathname: string, params: ParamsType): boolean =>
!isPendingPostView(pathname, params) &&
!isPostPageView(pathname, params) &&
!isSettingsView(pathname, params) &&
!isSubscriptionsView(pathname, params)
!isSubscriptionsView(pathname, params) &&
!isModQueueView(pathname)
);
};