import { getCurrent } from "@tauri-apps/api/window"; import { useEffect, useRef } from "react"; import styles from "./MainWindow.module.scss"; import { SidebarSection } from "./sidebar_section/SidebarSection"; import { MainSection } from "./main_section/MainSection"; import { useStartPython } from "@logics/useStartPython"; import { useConfig } from "@logics/useConfig"; export const MainWindow = () => { const { asyncStartPython } = useStartPython(); const hasRunRef = useRef(false); const main_window = getCurrent(); const { getSoftwareVersion } = useConfig(); useEffect(() => { main_window.setDecorations(true); if (!hasRunRef.current) { asyncStartPython().then((result) => { getSoftwareVersion(); }).catch((err) => { }); } return () => hasRunRef.current = true; }, []); return (
{t("main_window.cover_message")}