[bugfix] Fix window geometry bug that was not save and restore. changes the way how to get appWindow instance from Tauri.

This commit is contained in:
Sakamoto Shiina
2025-05-11 15:26:05 +09:00
parent 61e333401f
commit b2bc1e62cb
10 changed files with 53 additions and 68 deletions

View File

@@ -1,8 +1,9 @@
import { getCurrentWindow } from "@tauri-apps/api/window";
import { store } from "@store";
import { useStore_MessageInputBoxRatio } from "@store";
import { useStdoutToPython } from "@logics/useStdoutToPython";
import { clampMinMax } from "@utils";
export const useMessageInputBoxRatio = () => {
const appWindow = store.appWindow;
const { asyncStdoutToPython } = useStdoutToPython();
const { currentMessageInputBoxRatio, updateMessageInputBoxRatio } = useStore_MessageInputBoxRatio();
@@ -12,7 +13,6 @@ export const useMessageInputBoxRatio = () => {
};
const asyncSetMessageInputBoxRatio = async (ratio) => {
const appWindow = getCurrentWindow();
const minimized = await appWindow.isMinimized();
if (minimized === true) return; // don't save while the window is minimized.
const parsed = parseFloat(ratio.toFixed(2));