diff --git a/apps/client/src/features/app-settings/panel/integrations-panel/OscIntegrations.tsx b/apps/client/src/features/app-settings/panel/integrations-panel/OscIntegrations.tsx index fe9b2511a..0da95b1aa 100644 --- a/apps/client/src/features/app-settings/panel/integrations-panel/OscIntegrations.tsx +++ b/apps/client/src/features/app-settings/panel/integrations-panel/OscIntegrations.tsx @@ -1,3 +1,4 @@ +import { useEffect } from 'react'; import { Controller, useFieldArray, useForm } from 'react-hook-form'; import { Button, IconButton, Input, Select, Switch } from '@chakra-ui/react'; import { IoAdd } from '@react-icons/all-files/io5/IoAdd'; @@ -40,6 +41,13 @@ export default function OscIntegrations() { control, }); + // update form if we get new data from server + useEffect(() => { + if (data) { + reset(data); + } + }, [data, reset]); + const onSubmit = async (values: OSCSettings) => { if (values.portIn === values.portOut) { setError('portIn', { message: 'OSC IN and OUT Ports cant be the same' }); diff --git a/apps/server/src/api-data/db/db.controller.ts b/apps/server/src/api-data/db/db.controller.ts index 451f51d2e..7efe6aaa1 100644 --- a/apps/server/src/api-data/db/db.controller.ts +++ b/apps/server/src/api-data/db/db.controller.ts @@ -19,6 +19,9 @@ import * as projectService from '../../services/project-service/ProjectService.j import { ensureJsonExtension } from '../../utils/fileManagement.js'; import { generateUniqueFileName } from '../../utils/generateUniqueFilename.js'; import { appStateService } from '../../services/app-state-service/AppStateService.js'; +import { oscIntegration } from '../../services/integration-service/OscIntegration.js'; +import { httpIntegration } from '../../services/integration-service/HttpIntegration.js'; +import { DataProvider } from '../../classes/data-provider/DataProvider.js'; export async function patchPartialProjectFile(req: Request, res: Response) { // all fields are optional in validation @@ -32,6 +35,7 @@ export async function patchPartialProjectFile(req: Request, res: Response