[Refactor] Change state management structures. Async atom to be manage manually.

This commit is contained in:
Sakamoto Shiina
2024-09-23 03:44:33 +09:00
parent 586aaf0091
commit 0616092eff
49 changed files with 295 additions and 190 deletions

View File

@@ -3,15 +3,15 @@ import { useStdoutToPython } from "@logics/useStdoutToPython";
export const useEnableAutoClearMessageBox = () => {
const { asyncStdoutToPython } = useStdoutToPython();
const { currentEnableAutoClearMessageBox, updateEnableAutoClearMessageBox } = useStore_EnableAutoClearMessageBox();
const { currentEnableAutoClearMessageBox, updateEnableAutoClearMessageBox, pendingEnableAutoClearMessageBox } = useStore_EnableAutoClearMessageBox();
const getEnableAutoClearMessageBox = () => {
updateEnableAutoClearMessageBox(() => new Promise(() => {}));
pendingEnableAutoClearMessageBox();
asyncStdoutToPython("/get/auto_clear_message_box");
};
const toggleEnableAutoClearMessageBox = () => {
updateEnableAutoClearMessageBox(() => new Promise(() => {}));
pendingEnableAutoClearMessageBox();
if (currentEnableAutoClearMessageBox.data) {
asyncStdoutToPython("/set/disable_auto_clear_message_box");
} else {