Skip to content

Commit

Permalink
Merge pull request #661 from openstad/fix/back-to-document-relative-p…
Browse files Browse the repository at this point in the history
…ath-v2

fix: Use relative path for the back button to the document
  • Loading branch information
iandebruin98 authored Oct 23, 2024
2 parents 3fa0ecb + 30ccd20 commit 9e9d5de
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/resource-detail/src/resource-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,18 @@ function ResourceDetail({
if (hash && hash.includes('#doc=')) {
const docParams = hash.split('#doc=')[1];

if (docParams && docParams.includes('?')) {
const queryParams = docParams.split('?')[1];
const cleanDocParams = docParams.split('#')[0];

if (cleanDocParams && cleanDocParams.includes('?')) {
const queryParams = cleanDocParams.split('?')[1];

if (queryParams) {
const params = queryParams.split('&');

for (const param of params) {
const [key, value] = param.split('=');

if (key && value && !isNaN(Number(value))) {
if (value && !isNaN(Number(value))) {
return value;
}
}
Expand Down

0 comments on commit 9e9d5de

Please sign in to comment.