From 00ef3856ca0d147ef0e50a261d90d0fc7d41db69 Mon Sep 17 00:00:00 2001 From: Ajay Date: Tue, 8 Nov 2022 13:50:56 -0500 Subject: [PATCH] Fix race condition causing full video label not to display --- src/render/CategoryPill.tsx | 6 ++++-- 1 file 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(); 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) {