fix: editor fails to resize after toggling on macos

This commit is contained in:
dongchengjie
2024-07-08 21:40:56 +08:00
parent aa9e63b51a
commit 4e4f9af5b7
2 changed files with 7 additions and 2 deletions

View File

@@ -216,7 +216,12 @@ export const EditorViewer = <T extends Language>(props: Props<T>) => {
color="inherit"
title={t(isMaximized ? "Minimize" : "Maximize")}
onClick={() =>
appWindow.toggleMaximize().then(() => editorRef.current?.layout())
appWindow.toggleMaximize().then(() => {
editorRef.current?.layout();
setTimeout(() => {
editorRef.current?.layout();
}, 500);
})
}
>
{isMaximized ? <CloseFullscreenIcon /> : <OpenInFullIcon />}