[Remove] useWindow that is no longer in use for now.

This commit is contained in:
Sakamoto Shiina
2024-09-21 00:57:09 +09:00
parent 7573e99617
commit e20a4eecd1

View File

@@ -1,44 +0,0 @@
import { WebviewWindow } from "@tauri-apps/api/window";
import { store, useStore_IsOpenedConfigPage } from "@store";
import { getCurrent } from "@tauri-apps/api/window";
export const useWindow = () => {
const { updateIsOpenedConfigPage } = useStore_IsOpenedConfigPage();
const createConfigPage = async () => {
const main_page = getCurrent();
if (store.config_page === null) {
const config_page = new WebviewWindow("vrct_config_page",{
url: "./src-ui/windows/config_page/index.html",
center: true,
width: 1080,
height: 700,
title: "Settings"
});
config_page.once("tauri://created", function () {
store.config_page = config_page;
updateIsOpenedConfigPage(true);
});
config_page.once("tauri://error", function (e) {
console.log(e);
});
const unlisten_d = config_page.once("tauri://destroyed", (event) => {
store.config_page = null;
updateIsOpenedConfigPage(false);
unlisten_d();
});
main_page.onCloseRequested((event) => {
config_page.close();
});
}
};
const closeConfigPage = () => {
store.config_page.close();
};
return { createConfigPage, closeConfigPage };
};