Skip to content

Commit 4a43439

Browse files
committed
Log URLs for debugging
1 parent 05dc8e0 commit 4a43439

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sophora-components/src/routes/datawrapper-switcher/DatawrapperSwitcher.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,25 @@
1010
let fixedHeight = $state(null);
1111
let layout = $state('auto');
1212
13+
let url = $state('');
14+
1315
onMount(() => {
1416
const entries = getDataFromUrl(root);
1517
labels = entries.labels.split(',') || [];
1618
ids = entries.ids.split(',') || [];
1719
fixedHeight = entries.fixedHeight || null;
1820
layout = entries.layout || 'auto';
21+
22+
url = window.location?.href;
1923
});
2024
</script>
2125
2226
<div class="datawrapper-switcher" bind:this={root}>
2327
<DesignTokens theme="auto">
2428
<h1>Datawrapper switcher to be rendered here:</h1>
2529
<pre>{JSON.stringify({ labels, ids, fixedHeight, layout }, null, 2)}</pre>
30+
<pre>dataset url: {root?.parentNode?.parentNode?.dataset.url || 'n/a'}</pre>
31+
<pre>actual url: {url || 'n/a'}</pre>
2632
2733
<!-- <Switcher
2834
options={labels}

0 commit comments

Comments
 (0)