Skip to content

Commit 5226575

Browse files
committed
change window size when loading fully ends
1 parent 15a59b1 commit 5226575

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/App.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,21 @@ const App = memo(() => {
109109
changeLanguage(language as any);
110110
}, [language]);
111111

112+
useEffect(() => {
113+
if (!loading) {
114+
const targetSize = mainWindowSize.current || new LogicalSize(1000, 700);
115+
116+
Promise.all([
117+
appWindow.setResizable(true),
118+
appWindow.setSize(targetSize),
119+
]);
120+
121+
if (!IN_GAME) {
122+
appWindow.center();
123+
}
124+
}
125+
}, [loading]);
126+
112127
useEffect(() => {
113128
let killResizeListener: (() => void) | null = null;
114129

0 commit comments

Comments
 (0)