chore: ignore add close class in widget when embed mode

This commit is contained in:
Tristan Yang
2023-03-22 11:36:45 +08:00
parent 5bfcc0d3bf
commit 776138c7fc
+3 -1
View File
@@ -21,12 +21,14 @@ function Widget({ hostId }: Props) {
setVisible((prev) => !prev);
};
useEffect(() => {
if (embed) {
if (!visible) {
document.documentElement.classList.add("close");
} else {
document.documentElement.classList.remove("close");
}
}, [visible]);
}
}, [visible, embed]);
if (!rehydrated) return null;
if (!embed) return <Popup handleClose={toggleVisible} hostId={hostId} />;