Browse Source

fix: icon not change when toggle window maxinized (#799)

Damian Johnson 1 year ago
parent
commit
26af860eac
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/components/layout/layout-control.tsx

+ 4 - 2
src/components/layout/layout-control.tsx

@@ -15,8 +15,10 @@ export const LayoutControl = () => {
 
   const [isMaximized, setIsMaximized] = useState(false);
   const [isPined, setIsPined] = useState(false);
-  appWindow.isMaximized().then((isMaximized) => {
-    setIsMaximized(() => isMaximized);
+  appWindow.onResized(() => {
+    appWindow.isMaximized().then((isMaximized) => {
+      setIsMaximized(() => isMaximized);
+    });
   });
 
   return (