Skip to content

Commit 8128c4b

Browse files
committed
Fix updateState when signals aren't sent
Signed-off-by: Zvonimir Fras <zvonimir@zvonimirfras.com>
1 parent 0a5e842 commit 8128c4b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

player/react/src/lib/ui-fragment.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ export const UIFragment = ({ state, setState }: UIFragmentProps) => {
6767
};
6868

6969
const sendSignal: SendSignal = (id: number | string, signal: string, value?: any[], newComponentState?: any) => {
70-
if (!state.data.actions) {
71-
return;
72-
}
73-
74-
const subscriptions = state.data.actions.filter((action: Action) => action.source === id && action.signal === signal);
70+
const subscriptions = state.data.actions?.filter((action: Action) => action.source === id && action.signal === signal) || [];
7571

7672
setStateData((stateData: any) => updatedStateData(stateData, subscriptions, value, newComponentState));
7773
};

0 commit comments

Comments
 (0)