From 4e4f9af5b73d89f0a3101f42f1690bca0a38b4fe Mon Sep 17 00:00:00 2001 From: dongchengjie <37543964+dongchengjie@users.noreply.github.com> Date: Mon, 8 Jul 2024 21:40:56 +0800 Subject: [PATCH] fix: editor fails to resize after toggling on macos --- src/components/profile/editor-viewer.tsx | 7 ++++++- src/locales/zh.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/profile/editor-viewer.tsx b/src/components/profile/editor-viewer.tsx index 0ec82eb..d42158b 100644 --- a/src/components/profile/editor-viewer.tsx +++ b/src/components/profile/editor-viewer.tsx @@ -216,7 +216,12 @@ export const EditorViewer = (props: Props) => { 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 ? : } diff --git a/src/locales/zh.json b/src/locales/zh.json index 2d5e744..6fdef40 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -133,9 +133,9 @@ "Exclude Type": "排除节点类型", "Disable UDP": "禁用UDP", "Hidden": "隐藏代理组", - "Extend Config": "扩展配置", "Group Name Required": "代理组名称不能为空", "Group Name Already Exists": "代理组名称已存在", + "Extend Config": "扩展配置", "Extend Script": "扩展脚本", "Global Merge": "全局扩展配置", "Global Script": "全局扩展脚本",