[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

@@ -4,7 +4,7 @@ import { StartUpProgressContainer } from "./start_up_progress_container/StartUpP
import { DownloadModelsContainer } from "./download_models_container/DownloadModelsContainer/";
import MegaphoneSvg from "@images/megaphone.svg?react";
import XMarkSvg from "@images/cancel.svg?react";
import { getCurrentWindow } from "@tauri-apps/api/window";
import { useWindow } from "@logics_common";
import clsx from "clsx";
export const SplashComponent = () => {
@@ -73,13 +73,10 @@ const AnnouncementsContainer = () => {
const CloseButtonContainer = () => {
const asyncClose = async () => {
const appWindow = await getCurrentWindow();
appWindow.close();
};
const { asyncCloseApp } = useWindow();
return (
<button className={styles.close_button_wrapper} onClick={asyncClose}>
<button className={styles.close_button_wrapper} onClick={asyncCloseApp}>
<div className={styles.close_button}>
<XMarkSvg className={styles.x_mark_svg}/>
</div>