Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

WIP: fix #143 #146

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,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