[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,5 +1,4 @@
import { useState } from "react";
import { getCurrentWindow } from "@tauri-apps/api/window";
import { ErrorBoundary } from "react-error-boundary";
import XMarkSvg from "@images/cancel.svg?react";
import CopySvg from "@images/copy.svg?react";
@@ -7,6 +6,8 @@ import CheckMarkSvg from "@images/check_mark.svg?react";
import { ContactsContainer } from "./contacts_container/ContactsContainer";
import { useWindow } from "@logics_common";
import styles from "./AppErrorBoundary.module.scss";
export const AppErrorBoundary = ({children}) => {
@@ -65,14 +66,9 @@ const ErrorContainer = ({error}) => {
};
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>