Skip to content

Commit

Permalink
Merge pull request #193 from OpenWebhook/issue/191
Browse files Browse the repository at this point in the history
bugfix: handle case if previous is empty
  • Loading branch information
Samox authored Mar 9, 2023
2 parents c2ed295 + 4517504 commit 300fc0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/WebhookDisplay/WebhookList.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const QUERY_WEBHOOKS = gql`
`;

type QueryWebhook = {
webhooks: Array<Webhook>;
webhooks: Array<Webhook> | null;
};

const COMMENTS_SUBSCRIPTION = gql`
Expand Down Expand Up @@ -91,7 +91,7 @@ const WebhookList: React.FC = () => {
}
posthog.capture("New webhook received", { webhookId: newWebhook.id });
return Object.assign({}, prev, {
webhooks: [newWebhook, ...prev.webhooks],
webhooks: [newWebhook, ...(prev.webhooks || [])],
});
},
});
Expand Down

0 comments on commit 300fc0c

Please sign in to comment.