add route validation checks

This commit is contained in:
Tom (plebeius.eth)
2024-10-29 17:40:09 +01:00
parent b123102988
commit 6692c65c4b
19 changed files with 86 additions and 87 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ const Board = () => {
const { subplebbitAddress } = useParams<{ subplebbitAddress: string }>();
const { hideThreadsWithoutImages } = useInterfaceSettingsStore();
const isInAllView = isAllView(location.pathname, useParams());
const isInAllView = isAllView(location.pathname);
const defaultSubplebbitAddresses = useDefaultSubplebbitAddresses();
const account = useAccount();
+2 -2
View File
@@ -33,7 +33,7 @@ const Catalog = () => {
const location = useLocation();
const { subplebbitAddress } = useParams<{ subplebbitAddress: string }>();
const isInAllView = isAllView(location.pathname, useParams());
const isInAllView = isAllView(location.pathname);
const defaultSubplebbits = useDefaultSubplebbits();
const { hideAdultBoards, hideGoreBoards } = useInterfaceSettingsStore();
const { hideThreadsWithoutImages } = useInterfaceSettingsStore();
@@ -153,7 +153,7 @@ const Catalog = () => {
</div>
);
const params = useParams();
const params = useParams<{ sortType?: string; timeFilterName?: string }>();
const currentTimeFilterName = params?.timeFilterName || timeFilterName;
const Footer = () => {
+1 -1
View File
@@ -55,7 +55,7 @@ const PostPage = () => {
const params = useParams();
const location = useLocation();
const { commentCid, subplebbitAddress } = params;
const isInAllView = isAllView(location.pathname, params);
const isInAllView = isAllView(location.pathname);
const isInSettigsView = isSettingsView(location.pathname, params);
const isInDescriptionView = isDescriptionView(location.pathname, params);
const isInRulesView = isRulesView(location.pathname, params);