reload terminal when styel block is unmounted and mounted

This commit is contained in:
Red Adaya 2024-04-15 19:52:09 +08:00
parent 6b5d2833eb
commit 567e5b662c

View File

@ -35,10 +35,20 @@ class TermStyleBlock extends React.Component<{
themeName: string; themeName: string;
selector: string; selector: string;
}> { }> {
componentDidUpdate(): void { componentDidMount() {
GlobalModel.bumpTermRenderVersion(); GlobalModel.bumpTermRenderVersion();
} }
componentWillUnmount() {
GlobalModel.bumpTermRenderVersion();
}
componentDidUpdate(prevProps) {
if (prevProps.themeName !== this.props.themeName || prevProps.selector !== this.props.selector) {
GlobalModel.bumpTermRenderVersion();
}
}
isValidCSSColor(color) { isValidCSSColor(color) {
const element = document.createElement("div"); const element = document.createElement("div");
element.style.color = color; element.style.color = color;