Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Block Explorer UI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
Block Explorer UI
Commits
0031f69b
Commit
0031f69b
authored
2 months ago
by
Dima Rifai
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#412
- Validate Account in route starts with @ and is not empty
parent
7def51dc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pages/[accountName].tsx
+11
-1
11 additions, 1 deletion
pages/[accountName].tsx
with
11 additions
and
1 deletion
pages/[accountName].tsx
+
11
−
1
View file @
0031f69b
...
...
@@ -24,7 +24,7 @@ import { Button } from "@/components/ui/button";
import
{
Card
,
CardContent
,
CardHeader
,
CardTitle
}
from
"
@/components/ui/card
"
;
import
useConvertedAccountDetails
from
"
@/hooks/common/useConvertedAccountDetails
"
;
import
useDynamicGlobal
from
"
@/hooks/api/homePage/useDynamicGlobal
"
;
import
ErrorPage
from
"
./ErrorPage
"
;
interface
AccountSearchParams
{
accountName
?:
string
|
undefined
;
fromBlock
:
number
|
undefined
;
...
...
@@ -98,6 +98,7 @@ export default function Account() {
liveDataEnabled
,
dynamicGlobalData
);
const
accountOperationsProps
=
{
accountName
:
accountNameFromRoute
,
operationTypes
:
filtersParam
.
length
...
...
@@ -277,6 +278,15 @@ export default function Account() {
}
};
// get the accountName and treat it as a string
const
routeAccountName
=
Array
.
isArray
(
router
.
query
.
accountName
)
?
router
.
query
.
accountName
[
0
]
// If it's an array, get the first element
:
router
.
query
.
accountName
;
// Otherwise, treat it as a string directly
if
(
routeAccountName
&&
!
routeAccountName
.
startsWith
(
"
@
"
)
||
!
accountNameFromRoute
)
{
return
<
ErrorPage
/>;
}
if
(
!
accountDetails
)
{
return
(
<
Loader2
className
=
"animate-spin mt-1 text-black dark:text-white h-12 w-12 ml-3 ..."
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment