Skip to content

gi-nx


gi-nx / updateProjectApp

ts
function updateProjectApp(appId: string, cloned: 
  | GiraffeProjectApp
  | OtherProjectApp<Record<string, any>, Record<string, any>>): void;

Update a project app configuration.

Parameters

ParameterTypeDescription
appIdstringID of the app to update
cloned| GiraffeProjectApp | OtherProjectApp<Record<string, any>, Record<string, any>>Updated ProjectApp object (must be a clone, not mutated original)

Returns

void

Throws

Error if app JSON is too large

Needs Permission

Example

typescript
const thisAppsData = structuredClone(giraffeState.get('selectedProjectApp'));
thisAppsData.public.settings.someValue = newValue;
await rpc.invoke("updateProjectApp", [thisAppsData.app, thisAppsData]);

const giraffeAppData = structuredClone(giraffeState.get('projectAppsByAppID')['1']);
// update analytics display settings
giraffeAppData.public.counter.display.showUnitTotals = false;
await rpc.invoke("updateProjectApp", ['1', giraffeAppData]);