mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-20 15:23:39 +08:00
hotfix: auto set height
This commit is contained in:
@@ -37,10 +37,12 @@ export function HTMLPreview(props: {
|
|||||||
const { id, height, title } = e.data;
|
const { id, height, title } = e.data;
|
||||||
setTitle(title);
|
setTitle(title);
|
||||||
if (id == frameId.current) {
|
if (id == frameId.current) {
|
||||||
setIframeHeight(height);
|
if (height != iframeHeight + 40) {
|
||||||
|
setIframeHeight(height);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, []);
|
}, [iframeHeight]);
|
||||||
|
|
||||||
const height = useMemo(() => {
|
const height = useMemo(() => {
|
||||||
const parentHeight = props.height || 600;
|
const parentHeight = props.height || 600;
|
||||||
|
Reference in New Issue
Block a user