Skip to content

Commit

Permalink
clean up anti-pattern: move setPlaceholderType out of render to wil…
Browse files Browse the repository at this point in the history
…lUpdate
  • Loading branch information
iisa committed Jan 4, 2024
1 parent 317b916 commit c7a3ed5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/collection-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ export class CollectionBrowser
}

render() {
this.setPlaceholderType();
return html`
<div
id="content-container"
Expand Down Expand Up @@ -995,6 +994,11 @@ export class CollectionBrowser
this.restoreState();
}

willUpdate() {
console.log('willUpdate');
this.setPlaceholderType();
}

updated(changed: PropertyValues) {
if (changed.has('placeholderType') && this.placeholderType === null) {
if (!this.leftColIntersectionObserver) {
Expand Down

0 comments on commit c7a3ed5

Please sign in to comment.