Skip to content

Commit

Permalink
Fix back button (#180)
Browse files Browse the repository at this point in the history
The back button was broken because the `homepage="."` configuration
was incompatibile with how we were using the history API.

This means the page will now only work when hosted from the `/dapps/`
path.
  • Loading branch information
Gudahtt authored Jun 24, 2023
1 parent 84c0020 commit ba930fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"eject": "react-scripts eject",
"update-changelog": "./scripts/auto-changelog.sh"
},
"homepage": ".",
"homepage": "https://metamask.github.io/dapps/",
"eslintConfig": {
"extends": "react-app"
},
Expand Down
5 changes: 1 addition & 4 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ function App() {

if (isLoading) return null

const currentPath = window.location.pathname;
const basename = currentPath.startsWith('/dapps') ? '/dapps' : undefined;

return (
<Router basename={basename}>
<Router basename={'/dapps'}>
<ScrollToTop>
<div className="App">
<Route exact path="/" component={Home} />
Expand Down

0 comments on commit ba930fd

Please sign in to comment.