Skip to content

Commit

Permalink
Revert "Make new tab dashboard links work (plausible#4276)"
Browse files Browse the repository at this point in the history
This reverts commit fa065c8.
  • Loading branch information
aerosol committed Jun 25, 2024
1 parent fa065c8 commit 5fae58e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions assets/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ if (container) {
background: container.dataset.background,
isDbip: container.dataset.isDbip === 'true',
flags: JSON.parse(container.dataset.flags),
validIntervalsByPeriod: JSON.parse(container.dataset.validIntervalsByPeriod),
shared: !!container.dataset.sharedLinkAuth,
validIntervalsByPeriod: JSON.parse(container.dataset.validIntervalsByPeriod)
}

const loggedIn = container.dataset.loggedIn === 'true'
Expand Down
9 changes: 4 additions & 5 deletions assets/js/dashboard/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ function ScrollToTop() {
}

export default function Router({ site, loggedIn, currentUserRole }) {
console.info('xxx', site);
return (
<BrowserRouter basename={site.shared ? `/share/${encodeURI(site.domain)}` : encodeURI(site.domain)}>
<Route path="/">
<BrowserRouter>
<Route path="/:domain">
<ScrollToTop />
<Dash site={site} loggedIn={loggedIn} currentUserRole={currentUserRole} />
<Switch>
Expand All @@ -53,7 +52,7 @@ export default function Router({ site, loggedIn, currentUserRole }) {
<ExitPagesModal site={site} />
</Route>
<Route path="/:domain/countries">
<ModalTable title="Top countries" site={site} endpoint={url.apiPath(site, '/countries')} filterKey="country" keyLabel="Country" renderIcon={renderCountryIcon} showPercentage={true} />
<ModalTable title="Top countries" site={site} endpoint={url.apiPath(site, '/countries')} filterKey="country" keyLabel="Country" renderIcon={renderCountryIcon} showPercentage={true}/>
</Route>
<Route path="/:domain/regions">
<ModalTable title="Top regions" site={site} endpoint={url.apiPath(site, '/regions')} filterKey="region" keyLabel="Region" renderIcon={renderRegionIcon} />
Expand All @@ -72,7 +71,7 @@ export default function Router({ site, loggedIn, currentUserRole }) {
</Route>
</Switch>
</Route>
</BrowserRouter >
</BrowserRouter>
);
}

Expand Down

0 comments on commit 5fae58e

Please sign in to comment.