From 4cb48e73109d7841377e79521a96a4822447ae39 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 18 Feb 2020 20:13:01 -0800 Subject: [PATCH] fix: Document gets 'stuck' when navigating between docs with similar slugs closes #1175 --- app/scenes/Document/KeyedDocument.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scenes/Document/KeyedDocument.js b/app/scenes/Document/KeyedDocument.js index e6452288f..ba488c32e 100644 --- a/app/scenes/Document/KeyedDocument.js +++ b/app/scenes/Document/KeyedDocument.js @@ -15,7 +15,8 @@ class KeyedDocument extends React.Component<*> { // we only want to force a re-mount of the document component when the // document changes, not when the title does so only this portion is used // for the key. - const urlId = documentSlug ? documentSlug.split('-')[1] : undefined; + const urlParts = documentSlug ? documentSlug.split('-') : []; + const urlId = urlParts.length ? urlParts[urlParts.length - 1] : undefined; return ; }