[bugfix] Config Page: AdvancedSettings: Add save button to Entry components.

Add error handlings.
This commit is contained in:
Sakamoto Shiina
2025-03-21 17:38:15 +09:00
parent cbd8a77eb6
commit b8ade54e85
11 changed files with 153 additions and 38 deletions

View File

@@ -1,7 +1,9 @@
import { useStore_OscPort } from "@store";
import { useStdoutToPython } from "@logics/useStdoutToPython";
import { useNotificationStatus } from "@logics_common";
export const useOscPort = () => {
const { showNotification_Error } = useNotificationStatus();
const { asyncStdoutToPython } = useStdoutToPython();
const { currentOscPort, updateOscPort, pendingOscPort } = useStore_OscPort();
@@ -15,10 +17,17 @@ export const useOscPort = () => {
asyncStdoutToPython("/set/data/osc_port", osc_port);
};
const saveErrorOscPort = ({data, message, _result}) => {
updateOscPort(d => d.data);
showNotification_Error(_result);
};
return {
currentOscPort,
getOscPort,
updateOscPort,
setOscPort,
saveErrorOscPort,
};
};