[Update] AdvancedSettings: OSC IP Address: Add error notifications.

Add 500 status error message.
This commit is contained in:
Sakamoto Shiina
2025-03-22 17:28:31 +09:00
parent df344baa06
commit a5e59af885
3 changed files with 20 additions and 22 deletions

View File

@@ -1,9 +1,7 @@
import { useStore_OscIpAddress } from "@store";
import { useStdoutToPython } from "@logics/useStdoutToPython";
import { useNotificationStatus } from "@logics_common";
export const useOscIpAddress = () => {
const { showNotification_Error } = useNotificationStatus();
const { asyncStdoutToPython } = useStdoutToPython();
const { currentOscIpAddress, updateOscIpAddress, pendingOscIpAddress } = useStore_OscIpAddress();
@@ -17,17 +15,10 @@ export const useOscIpAddress = () => {
asyncStdoutToPython("/set/data/osc_ip_address", osc_ip_address);
};
const saveErrorOscIpAddress = ({data, message, _result}) => {
updateOscIpAddress(d => d.data);
showNotification_Error(_result);
};
return {
currentOscIpAddress,
getOscIpAddress,
updateOscIpAddress,
setOscIpAddress,
saveErrorOscIpAddress,
};
};