Skip to content

Commit

Permalink
hotfix: optimize select filter function
Browse files Browse the repository at this point in the history
  • Loading branch information
luistorres committed Apr 24, 2024
1 parent 6212ff0 commit 6fe00c3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/web-app/app/_lib/queries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ export const useFetchIdOSProfile = () => {
});
};

const filterCredentials = (credentials: idOSCredential[] | null) =>
credentials && credentials.filter((credential) => !credential.original_id);

export const useFetchCredentials = () => {
const { sdk, hasSigner, address } = useIdOS();

Expand All @@ -83,9 +86,7 @@ export const useFetchCredentials = () => {
.map((c) => c.id),
}));
},
select: (credentials) =>
credentials &&
credentials.filter((credential) => !credential.original_id),
select: filterCredentials,
enabled: !!(sdk && hasSigner && address),
});
};
Expand Down

0 comments on commit 6fe00c3

Please sign in to comment.