Skip to content

Commit

Permalink
Fix updateState when signals aren't sent
Browse files Browse the repository at this point in the history
Signed-off-by: Zvonimir Fras <[email protected]>
  • Loading branch information
zvonimirfras committed Feb 1, 2024
1 parent 0a5e842 commit 8128c4b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions player/react/src/lib/ui-fragment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ export const UIFragment = ({ state, setState }: UIFragmentProps) => {
};

const sendSignal: SendSignal = (id: number | string, signal: string, value?: any[], newComponentState?: any) => {
if (!state.data.actions) {
return;
}

const subscriptions = state.data.actions.filter((action: Action) => action.source === id && action.signal === signal);
const subscriptions = state.data.actions?.filter((action: Action) => action.source === id && action.signal === signal) || [];

setStateData((stateData: any) => updatedStateData(stateData, subscriptions, value, newComponentState));
};
Expand Down

0 comments on commit 8128c4b

Please sign in to comment.