Skip to content

Commit c74eeb9

Browse files
authored
fix(issues): Handle null starred issue views (#104169)
1 parent f755d4c commit c74eeb9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

static/app/views/nav/secondary/sections/issues/issueViews/useStarredIssueViews.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function useStarredIssueViews() {
1111
const organization = useOrganization();
1212
const queryClient = useQueryClient();
1313

14-
const {data: groupSearchViews} = useApiQuery<StarredGroupSearchView[]>(
14+
const {data: groupSearchViews} = useApiQuery<Array<StarredGroupSearchView | null>>(
1515
makeFetchStarredGroupSearchViewsKey({orgSlug: organization.slug}),
1616
{notifyOnChangeProps: ['data'], staleTime: 0}
1717
);
@@ -21,7 +21,9 @@ export function useStarredIssueViews() {
2121
// XXX (malwilley): Issue views without the nav require at least one issue view,
2222
// so they respond with "fake" issue views that do not have an ID.
2323
// We should remove this from the backend and here once we remove the tab-based views.
24-
?.filter(view => defined(view.id))
24+
?.filter(
25+
(view): view is StarredGroupSearchView => defined(view) && defined(view.id)
26+
)
2527
.map(convertGSVtoIssueView) ?? [];
2628

2729
const setStarredIssueViews = useCallback(

0 commit comments

Comments
 (0)