Skip to content

Commit

Permalink
Fix scroll jump when returning back to stake tab
Browse files Browse the repository at this point in the history
  • Loading branch information
behrang committed Oct 18, 2023
1 parent 363405f commit 51698af
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/Model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ export class Model {
const fragmentState: FragmentState = {}
if (window.location.hash.startsWith('#')) {
const fragment = window.location.hash.substring(1)
const pairs = fragment.split(',')
const pairs = fragment.split('/')
for (const pair of pairs) {
const [key, value] = pair.split('=', 2)
if (key === 'network') {
Expand Down Expand Up @@ -764,17 +764,15 @@ export class Model {
writeFragmentState = () => {
let hash = ''
if (this.network !== defaultNetwork) {
hash += ',network=' + this.network
hash += '/network=' + this.network
}
if (this.referrer != null) {
hash += ',referrer=' + this.referrer.toString({ testOnly: !this.isMainnet, bounceable: false })
hash += '/referrer=' + this.referrer.toString({ testOnly: !this.isMainnet, bounceable: false })
}
if (this.activeTab !== defaultActiveTab) {
hash += ',tab=' + this.activeTab
}
if (hash.startsWith(',')) {
hash = hash.substring(1)
hash += '/tab=' + this.activeTab
}
hash += '/'
window.location.hash = hash
}
}
Expand Down

0 comments on commit 51698af

Please sign in to comment.