Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/pages/realtime-metrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,18 @@ export const Component = () => {
const isAdmin = user?.admin === true;

const appOptions = useMemo(() => {
return (apps || [])
.filter((app) => !!app.appKey)
.map((app) => ({
label: app.name,
value: app.appKey as string,
}));
return (apps || []).reduce<{ label: string; value: string }[]>(
(acc, app) => {
if (app.appKey) {
acc.push({
label: app.name,
value: app.appKey as string,
});
}
return acc;
},
[],
);
}, [apps]);

// Sync URL param to state on mount or URL change
Expand Down