Skip to content

Commit

Permalink
fix links in the browser history after a search redirect (#1217)
Browse files Browse the repository at this point in the history
Fixes #1173
  • Loading branch information
tom2drum authored Sep 29, 2023
1 parent e82a7a0 commit b2b1c37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/pages/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ const SearchResultsPageContent = () => {
if (redirectCheckQuery.data?.redirect && redirectCheckQuery.data.parameter) {
switch (redirectCheckQuery.data.type) {
case 'block': {
router.push({ pathname: '/block/[height_or_hash]', query: { height_or_hash: redirectCheckQuery.data.parameter } });
router.replace({ pathname: '/block/[height_or_hash]', query: { height_or_hash: redirectCheckQuery.data.parameter } });
return;
}
case 'address': {
router.push({ pathname: '/address/[hash]', query: { hash: redirectCheckQuery.data.parameter } });
router.replace({ pathname: '/address/[hash]', query: { hash: redirectCheckQuery.data.parameter } });
return;
}
case 'transaction': {
router.push({ pathname: '/tx/[hash]', query: { hash: redirectCheckQuery.data.parameter } });
router.replace({ pathname: '/tx/[hash]', query: { hash: redirectCheckQuery.data.parameter } });
return;
}
}
Expand Down

0 comments on commit b2b1c37

Please sign in to comment.