diff --git a/src-ui/logics/useWindow.js b/src-ui/logics/useWindow.js deleted file mode 100644 index 21cee2cf..00000000 --- a/src-ui/logics/useWindow.js +++ /dev/null @@ -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 }; -}; \ No newline at end of file