-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix: keep search text #684
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
On first render, in 404 page, it cannot get search text from url, next.js has a related open issue: #35990. Update: Update: const queryKey = 'search'
const queryValue = query[queryKey] || asPath.match(new RegExp(`[&?]${queryKey}=(.*)(&|$)`)) |
@@ -34,12 +34,6 @@ export const handleSearchKeyPress = async (e: React.KeyboardEvent<HTMLInputEleme | |||
return | |||
} | |||
|
|||
if (Number.isNaN(+search)) { |
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 not check if the search
is a hash or block number before the request?
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.
I've got it
fix redirect to tokens list logic, if token name is matched, go to token details page directly
But the solution is improper because there could be many tokens having a same token name
while the API only returns the first one, which is misleading
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.
@zmcNotafraid we'd better remove the function of searching by token name, or return a list instead of the first record
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.
The API will be updated along with Magickbase/godwoken_explorer#1159 and a new page of matched token list will be added in the future.
Now just let's just recover the checking of token name
before sending the request @qiweiii
Codecov Report
@@ Coverage Diff @@
## develop #684 +/- ##
===========================================
+ Coverage 56.81% 56.91% +0.10%
===========================================
Files 11 11
Lines 704 701 -3
Branches 423 423
===========================================
- Hits 400 399 -1
+ Misses 278 276 -2
Partials 26 26
|
@FrederLu fixed, please check |
@FrederLu fixed |
resolves Magickbase/godwoken_explorer#1107