Skip to content

Commit

Permalink
Use svelte replaceState()
Browse files Browse the repository at this point in the history
  • Loading branch information
ezynda3 committed Mar 10, 2024
1 parent 970ad00 commit 9126f36
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routes/diamond/[address]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import WriteFacetMethods from './WriteFacetMethods.svelte'
import { page } from '$app/stores'
import { browser } from '$app/environment'
import { replaceState } from '$app/navigation'
export let data: PageData
let selectedTab = $page.url.hash.replace('#', '') || 'facets'
Expand Down Expand Up @@ -61,7 +62,7 @@
$: {
if (browser) {
window.history.replaceState({}, '', `${$page.url.pathname}${$page.url.search}#${selectedTab}`)
replaceState(`${$page.url.pathname}${$page.url.search}#${selectedTab}`, $page.state)
}
}
</script>
Expand Down

0 comments on commit 9126f36

Please sign in to comment.