Skip to content

Commit

Permalink
fix: mark hash params as read when hash value is empty (#147)
Browse files Browse the repository at this point in the history
An improvement for #144 when hash param is empty on first read
  • Loading branch information
megheaiulian authored Feb 11, 2021
1 parent e642751 commit 618f46b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cosmoz-data-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -978,8 +978,14 @@ class CosmozDataNav extends hauntedPolymer('haunted', useDataNav)(PolymerElement
}

const path = ['_routeHashParams', hashParam],
hashValue = this.get(path),
selection = this.items.findIndex(i => this._getItemId(i) === hashValue);
hashValue = this.get(path);

if (!hashValue) {
this._readFromHashOnce = true;
return;
}

const selection = this.items.findIndex(i => this._getItemId(i) === hashValue);

if (selection < 0 || selection === this.selected) {
return;
Expand Down

0 comments on commit 618f46b

Please sign in to comment.