From b2c75e3aeed6a4d0205e1714859926fc04d0e192 Mon Sep 17 00:00:00 2001 From: Lopez <272230284+LopezDev7@users.noreply.github.com> Date: Fri, 14 Aug 2026 22:24:00 -0500 Subject: [PATCH] fix: restore main window size after the loading screen --- src/App.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 3c0f7368..e4b785c7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -33,6 +33,9 @@ import PerformanceMonitor from "./utils/performance"; import { PING_TIMEOUT_VALUE } from "./utils/query"; import { sc } from "./utils/sizeScaler"; +const LOADING_WINDOW_SIZE = new LogicalSize(250, 300); +const DEFAULT_WINDOW_SIZE = new LogicalSize(1000, 700); + // Lazy load heavy components for better initial load time const MainView = lazy(() => import("./containers/MainBody")); const NavBar = lazy(() => import("./containers/NavBar")); @@ -89,9 +92,18 @@ const App = memo(() => { mainWindowSize.current = innerSize.toLogical(scaleFactor); + // If the window is already at the loading size (e.g. after a reload), + // do not capture it as the main window size. + if ( + mainWindowSize.current.width === LOADING_WINDOW_SIZE.width && + mainWindowSize.current.height === LOADING_WINDOW_SIZE.height + ) { + mainWindowSize.current = DEFAULT_WINDOW_SIZE; + } + // Set window attributes for loading screen await Promise.all([ - appWindow.setSize(new LogicalSize(250, 300)), + appWindow.setSize(LOADING_WINDOW_SIZE), appWindow.setResizable(false), appWindow.center(), ]); @@ -128,7 +140,7 @@ const App = memo(() => { useEffect(() => { if (!loading) { - const targetSize = mainWindowSize.current || new LogicalSize(1000, 700); + const targetSize = mainWindowSize.current || DEFAULT_WINDOW_SIZE; Promise.all([ appWindow.setResizable(true),