Files
VRCT/src-ui/logics/configs/advanced_settings/useOscIpAddress.js
Sakamoto Shiina a5e59af885 [Update] AdvancedSettings: OSC IP Address: Add error notifications.
Add 500 status error message.
2025-03-22 17:28:31 +09:00

24 lines
757 B
JavaScript

import { useStore_OscIpAddress } from "@store";
import { useStdoutToPython } from "@logics/useStdoutToPython";
export const useOscIpAddress = () => {
const { asyncStdoutToPython } = useStdoutToPython();
const { currentOscIpAddress, updateOscIpAddress, pendingOscIpAddress } = useStore_OscIpAddress();
const getOscIpAddress = () => {
pendingOscIpAddress();
asyncStdoutToPython("/get/data/osc_ip_address");
};
const setOscIpAddress = (osc_ip_address) => {
pendingOscIpAddress();
asyncStdoutToPython("/set/data/osc_ip_address", osc_ip_address);
};
return {
currentOscIpAddress,
getOscIpAddress,
updateOscIpAddress,
setOscIpAddress,
};
};