Skip to content

Commit

Permalink
include create events in push widget
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasbach committed Aug 1, 2023
1 parent f0597ce commit 88bae7f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/home/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const Footer: FC = () => {
Star this project on Github.
</Link>{" "}
<NavLink to="/privacy" className="unstyled-link">
{/* eslint-disable-next-line */}
<Link>Privacy Policy</Link>
</NavLink>
</Box>
Expand Down
10 changes: 9 additions & 1 deletion src/widgets/create-pr-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@ const useRecentPushes = () => {
}),
{ refetchOnWindowFocus: false }
);
return useMemo(() => data?.data.filter((item) => item.type === "PushEvent"), [data]);
return useMemo(
() =>
data?.data.filter(
(item) =>
item.type === "PushEvent" ||
(item.type === "CreateEvent" && item.payload.ref_type === "branch" && item.payload.pusher_type === "user")

Check failure on line 54 in src/widgets/create-pr-widget.tsx

View workflow job for this annotation

GitHub Actions / test

Property 'ref_type' does not exist on type '{ action?: string | undefined; issue?: { id: number; node_id: string; url: string; repository_url: string; labels_url: string; comments_url: string; events_url: string; html_url: string; number: number; ... 24 more ...; reactions?: { ...; } | undefined; } | undefined; comment?: { ...; } | undefined; pages?: { ...; }...'.

Check failure on line 54 in src/widgets/create-pr-widget.tsx

View workflow job for this annotation

GitHub Actions / test

Property 'pusher_type' does not exist on type '{ action?: string | undefined; issue?: { id: number; node_id: string; url: string; repository_url: string; labels_url: string; comments_url: string; events_url: string; html_url: string; number: number; ... 24 more ...; reactions?: { ...; } | undefined; } | undefined; comment?: { ...; } | undefined; pages?: { ...; }...'.

Check failure on line 54 in src/widgets/create-pr-widget.tsx

View workflow job for this annotation

GitHub Actions / test

Property 'ref_type' does not exist on type '{ action?: string | undefined; issue?: { id: number; node_id: string; url: string; repository_url: string; labels_url: string; comments_url: string; events_url: string; html_url: string; number: number; ... 24 more ...; reactions?: { ...; } | undefined; } | undefined; comment?: { ...; } | undefined; pages?: { ...; }...'.

Check failure on line 54 in src/widgets/create-pr-widget.tsx

View workflow job for this annotation

GitHub Actions / test

Property 'pusher_type' does not exist on type '{ action?: string | undefined; issue?: { id: number; node_id: string; url: string; repository_url: string; labels_url: string; comments_url: string; events_url: string; html_url: string; number: number; ... 24 more ...; reactions?: { ...; } | undefined; } | undefined; comment?: { ...; } | undefined; pages?: { ...; }...'.
),
[data]
);
};

const usePrOptions = () => {
Expand Down

0 comments on commit 88bae7f

Please sign in to comment.