-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move route address validation from AccountPage into routes #1145
Conversation
🦙 MegaLinter status: ✅ SUCCESS
See errors details in artifact MegaLinter reports on CI Job page |
Codecov Report
@@ Coverage Diff @@
## master #1145 +/- ##
==========================================
- Coverage 84.91% 84.52% -0.40%
==========================================
Files 126 127 +1
Lines 2374 2384 +10
Branches 570 574 +4
==========================================
- Hits 2016 2015 -1
- Misses 358 369 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
|
110c65e
to
ef11ea1
Compare
src/app/pages/AccountPage/index.tsx
Outdated
<AlertBox color={'status-error'}>{t('errors.invalidAddress', 'Invalid address')}</AlertBox> | ||
</Box> | ||
) | ||
export async function validateRoute(params: AccountPageParams) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why it's async?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover
@@ -29,6 +25,10 @@ export const commonRoutes: Route[] = [ | |||
{ | |||
path: 'account/:address/*', | |||
element: <AccountPage />, | |||
errorElement: <ErrorBoundary></ErrorBoundary>, | |||
loader: async ({ params }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async not needed anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oddly it works that way too, but all documentation and router code looks like it intends loader to return a Response or Promise. I'd keep it
234ba02
to
79430aa
Compare
Related to #1004 (comment)
and #1079 (comment)