Skip to content

Commit

Permalink
WIP: fix PREreview#143
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardosfl committed Jul 18, 2020
1 parent 3f668bf commit 380b1df
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function App({ user }) {
<Moderate />
</Suspense>
</ModeratorRoute>
<Route exact={true} path="/:identifierPart1/:identifierPart2?">
<Route exact={true} path="/:identifierPart1/:identifierPart2?/:identifierPart3?">
<ExtensionFallback />
</Route>

Expand Down
4 changes: 2 additions & 2 deletions src/components/extension-fallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const PdfViewer = React.lazy(() =>

export default function ExtensionFallback() {
const location = useLocation(); // location.state can be {preprint, tab} with tab being `request` or `review` (so that we know on which tab the shell should be activated with
const { identifierPart1, identifierPart2 } = useParams();
const identifier = [identifierPart1, identifierPart2]
const { identifierPart1, identifierPart2, identifierPart3 } = useParams();
const identifier = [identifierPart1, identifierPart2, identifierPart3]
.filter(Boolean)
.join('/');

Expand Down
2 changes: 1 addition & 1 deletion src/utils/ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function createPreprintId(
);
}

return `preprint:${vendor}-${unprefix(id).replace('/', '-')}`;
return `preprint:${vendor}-${unprefix(id).replace(/\//g, '-')}`;
}

export function createPreprintIdentifierCurie(
Expand Down

0 comments on commit 380b1df

Please sign in to comment.