Auto update hidden categories when redeemed

This commit is contained in:
Ajay
2022-09-02 14:38:49 -04:00
parent 39ed7ea83c
commit c8e2bb0c13
4 changed files with 49 additions and 12 deletions

View File

@@ -4,12 +4,20 @@ import CategoryChooserComponent from "../components/options/CategoryChooserCompo
class CategoryChooser {
ref: React.RefObject<CategoryChooserComponent>;
constructor(element: Element) {
this.ref = React.createRef();
ReactDOM.render(
<CategoryChooserComponent/>,
<CategoryChooserComponent ref={this.ref} />,
element
);
}
update(): void {
this.ref.current?.forceUpdate();
}
}
export default CategoryChooser;

View File

@@ -4,12 +4,21 @@ import UnsubmittedVideosComponent from "../components/options/UnsubmittedVideosC
class UnsubmittedVideos {
ref: React.RefObject<UnsubmittedVideosComponent>;
constructor(element: Element) {
this.ref = React.createRef();
ReactDOM.render(
<UnsubmittedVideosComponent/>,
<UnsubmittedVideosComponent ref={this.ref} />,
element
);
}
update(): void {
this.ref.current?.forceUpdate();
}
}
export default UnsubmittedVideos;