Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Commit

Permalink
Fix bug with send button being disabled on valid JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
farskid committed Sep 8, 2021
1 parent 450b577 commit 7cc57c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/EventsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,13 @@ const newEventMachine = newEventModel.createMachine({
on: {
'*': [
{
cond: (ctx) => {
cond: (_, e) => {
try {
const eventObject = JSON.parse(ctx.eventString);
const eventObject = JSON.parse(
(e as ReturnType<
typeof newEventModel.events['EVENT.PAYLOAD']
>).value,
);
return typeof eventObject.type === 'string';
} catch (e) {
return false;
Expand Down

0 comments on commit 7cc57c8

Please sign in to comment.