refactor dynamic time filter logic, let user choose any hour value in time filter params

This commit is contained in:
Tom (plebeius.eth)
2024-11-17 15:58:13 +01:00
parent 9ee6966c26
commit 24816c6aa8
2 changed files with 31 additions and 20 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ const ValidateRouteParams = () => {
accountComments?.length > 0 &&
parseInt(accountCommentIndex) < accountComments.length);
const isDynamicTimeFilter = (filter: string) => /^\d+[dwmy]$/.test(filter);
const isDynamicTimeFilter = (filter: string) => /^\d+[hdwmy]$/.test(filter);
const isTimeFilterNameValid =
!timeFilterName || timeFilterNames.includes(timeFilterName as any) || timeFilterName === lastVisitTimeFilterName || isDynamicTimeFilter(timeFilterName);