[Update] 設定ページ開閉時に、音声認識オンオフ状態の復元を実装。
※今まではBackendで状態復元をしていたが、処理があれなのでUI側での便利機能としてUIが管理することに。
This commit is contained in:
22
src-ui/logics/common/useIsOpenedConfigPage.js
Normal file
22
src-ui/logics/common/useIsOpenedConfigPage.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { useStore_IsOpenedConfigPage } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useIsOpenedConfigPage = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentIsOpenedConfigPage, updateIsOpenedConfigPage } = useStore_IsOpenedConfigPage();
|
||||
|
||||
const setIsOpenedConfigPage = (is_opened) => {
|
||||
updateIsOpenedConfigPage(is_opened);
|
||||
// if (is_opened) {
|
||||
// asyncStdoutToPython("/set/enable/config_window");
|
||||
// } else {
|
||||
// asyncStdoutToPython("/set/disable/config_window");
|
||||
// }
|
||||
};
|
||||
|
||||
return {
|
||||
currentIsOpenedConfigPage,
|
||||
setIsOpenedConfigPage,
|
||||
updateIsOpenedConfigPage,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user