From 380b1dfd329978505d861c5ae2af9ac0d1c1c383 Mon Sep 17 00:00:00 2001 From: leonardosfl Date: Sat, 18 Jul 2020 15:44:17 -0300 Subject: [PATCH] WIP: fix #143 --- src/components/app.js | 2 +- src/components/extension-fallback.js | 4 ++-- src/utils/ids.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/app.js b/src/components/app.js index 39cc93b..b6af59d 100644 --- a/src/components/app.js +++ b/src/components/app.js @@ -91,7 +91,7 @@ export default function App({ user }) { - + diff --git a/src/components/extension-fallback.js b/src/components/extension-fallback.js index 5023fee..8d426d1 100644 --- a/src/components/extension-fallback.js +++ b/src/components/extension-fallback.js @@ -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('/'); diff --git a/src/utils/ids.js b/src/utils/ids.js index cb2f125..3abefb1 100644 --- a/src/utils/ids.js +++ b/src/utils/ids.js @@ -41,7 +41,7 @@ export function createPreprintId( ); } - return `preprint:${vendor}-${unprefix(id).replace('/', '-')}`; + return `preprint:${vendor}-${unprefix(id).replace(/\//g, '-')}`; } export function createPreprintIdentifierCurie(