Skip to content

Commit

Permalink
Fix an infinite scroller call that requires full reload, not just vis…
Browse files Browse the repository at this point in the history
…ible cell refresh (#284)

* Fix an infinite scroller call that requires full reload, not just visible cell refresh

* Update tests
  • Loading branch information
latonv authored Aug 8, 2023
1 parent e38745c commit 03b4583
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/collection-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ export class CollectionBrowser
changed.has('baseImageUrl') ||
changed.has('loggedIn')
) {
this.infiniteScroller?.refreshAllVisibleCells();
this.infiniteScroller?.reload();
}

if (
Expand Down
3 changes: 1 addition & 2 deletions test/collection-browser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1211,8 +1211,7 @@ describe('Collection Browser', () => {
await el.updateComplete;

const infiniteScroller = el.shadowRoot?.querySelector('infinite-scroller');
(infiniteScroller as InfiniteScroller).refreshAllVisibleCells =
infiniteScrollerRefreshSpy;
(infiniteScroller as InfiniteScroller).reload = infiniteScrollerRefreshSpy;
expect(infiniteScrollerRefreshSpy.called).to.be.false;
expect(infiniteScrollerRefreshSpy.callCount).to.equal(0);

Expand Down

0 comments on commit 03b4583

Please sign in to comment.