aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/render
diff options
context:
space:
mode:
authorAjay <[email protected]>2022-11-08 13:50:56 -0500
committerAjay <[email protected]>2022-11-08 13:50:56 -0500
commit00ef3856ca0d147ef0e50a261d90d0fc7d41db69 (patch)
tree55bfa4e228158c2023098cc92a9c165aa6db52e7 /src/render
parentcd7d74fb33832c8efc7e6bae1aeecb5e3b1a0b1c (diff)
downloadSponsorBlock-00ef3856ca0d147ef0e50a261d90d0fc7d41db69.tar.gz
SponsorBlock-00ef3856ca0d147ef0e50a261d90d0fc7d41db69.zip
Fix race condition causing full video label not to display
Diffstat (limited to 'src/render')
-rw-r--r--src/render/CategoryPill.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/render/CategoryPill.tsx b/src/render/CategoryPill.tsx
index e5d8f96e..f8ec1791 100644
--- a/src/render/CategoryPill.tsx
+++ b/src/render/CategoryPill.tsx
@@ -43,8 +43,10 @@ export class CategoryPill {
this.root.render(<CategoryPillComponent ref={this.ref} vote={vote} />);
if (this.unsavedState) {
- this.ref.current?.setState(this.unsavedState);
- this.unsavedState = null;
+ GenericUtils.wait(() => this.ref.current).then(() => {
+ this.ref.current?.setState(this.unsavedState);
+ this.unsavedState = null;
+ });
}
if (onMobileYouTube) {