Skip to content

Commit

Permalink
fix(element): check type of actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadhonarvar authored and alimd committed Mar 17, 2023
1 parent 3b1df45 commit f39d617
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/element/src/reactive-controllers/finite-state-machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export class FiniteStateMachineController<
if ('actions' in this.config.signalRecord![signalId]) {
// TODO: Check array type of `actions`

listenerCallback = this.config.signalRecord?.[signalId].actions as ListenerFunction<Stringifyable>;
if (!Array.isArray(this.config.signalRecord?.[signalId].actions)) {
listenerCallback = this.config.signalRecord?.[signalId].actions as ListenerFunction<Stringifyable>;
}
}

if (listenerCallback) {
Expand Down

0 comments on commit f39d617

Please sign in to comment.