[Update/bugfix] To get software version.(show it to the console for now.)

fix the error that was wrong amount arguments.
This commit is contained in:
Sakamoto Shiina
2024-08-08 16:36:40 +09:00
parent e9de5df8a5
commit e8fd6b724d
8 changed files with 66 additions and 8 deletions

View File

@@ -4,7 +4,14 @@ import { Topbar } from "./topbar/Topbar";
import { SidebarSection } from "./sidebar_section/SidebarSection";
import { SettingSection } from "./setting_section/SettingSection.jsx";
import { useSoftwareVersion } from "@store";
import { useTranslation } from "react-i18next";
// import { useConfig } from "@logics/useConfig";
export const ConfigWindow = () => {
const { currentSoftwareVersion, updateSoftwareVersion } = useSoftwareVersion();
const { t } = useTranslation();
return (
<div className={styles.container}>
<Topbar />
@@ -12,6 +19,11 @@ export const ConfigWindow = () => {
<SidebarSection />
<SettingSection />
</div>
<p className={styles.software_version}>
{
t("config_window.version", {version: currentSoftwareVersion})
}
</p>
</div>
);
};

View File

@@ -6,6 +6,7 @@
justify-content: space-between;
background-color: var(--dark_950_color);
overflow: hidden;
position: relative;
}
.main_container {
@@ -13,4 +14,11 @@
height: 100%;
display: flex;
padding-top: var(--config_window_topbar_height);
}
.software_version {
position: absolute;
bottom: 0.8rem;
left: 1.2rem;
font-size: 1.4rem;
}

View File

@@ -4,16 +4,23 @@ 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();
asyncStartPython().then((result) => {
getSoftwareVersion();
}).catch((err) => {
});
}
return () => hasRunRef.current = true;
}, []);