mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix: wrong route check, default time filter value, missing translation
This commit is contained in:
@@ -81,7 +81,7 @@ export const TimeFilter = ({ isInAllView, isInCatalogView, isInSubscriptionsView
|
||||
const params = useParams();
|
||||
const navigate = useNavigate();
|
||||
const { timeFilterNames } = useTimeFilter();
|
||||
const selectedTimeFilterName = params.timeFilterName;
|
||||
const selectedTimeFilterName = params.timeFilterName || '24h';
|
||||
|
||||
const changeTimeFilter = (event: React.ChangeEvent<HTMLSelectElement>) => {
|
||||
const timeFilterName = event.target.value;
|
||||
@@ -226,7 +226,7 @@ export const DesktopBoardButtons = () => {
|
||||
)}
|
||||
{(isInAllView || isInSubscriptionsView) && (
|
||||
<>
|
||||
<TimeFilter isInAllView={isInAllView} isInCatalogView={false} isInSubscriptionsView={isInSubscriptionsView} />
|
||||
<TimeFilter isInAllView={isInAllView} isInCatalogView={isInCatalogView} isInSubscriptionsView={isInSubscriptionsView} />
|
||||
</>
|
||||
)}
|
||||
</span>
|
||||
|
||||
@@ -20,7 +20,8 @@ export const isCatalogView = (pathname: string, params: ParamsType): boolean =>
|
||||
const decodedPathname = decodeURIComponent(pathname);
|
||||
|
||||
return (
|
||||
decodedPathname === `/p/${subplebbitAddress}/catalog` ||
|
||||
decodedPathname === `/p/${subplebbitAddress}/catalog/settings` ||
|
||||
decodedPathname === `/p/all/catalog/settings` ||
|
||||
decodedPathname === `/p/all/catalog` ||
|
||||
decodedPathname === `/p/all/catalog/${timeFilterName}` ||
|
||||
decodedPathname === `/p/subscriptions/catalog` ||
|
||||
|
||||
@@ -110,7 +110,7 @@ const Catalog = () => {
|
||||
const feedOptions: any = {
|
||||
subplebbitAddresses,
|
||||
sortType,
|
||||
postsPerPage: isInAllView || isInSubscriptionsView ? 10 : 25,
|
||||
postsPerPage: isInAllView || isInSubscriptionsView ? 10 : postsPerPage,
|
||||
};
|
||||
|
||||
if (isInAllView || isInSubscriptionsView) {
|
||||
|
||||
Reference in New Issue
Block a user