Skip to content

Commit

Permalink
fix(dapp): campaign verify failed popup (#619)
Browse files Browse the repository at this point in the history
Signed-off-by: Urban Vidovič <[email protected]>
Co-authored-by: martines3000 <[email protected]>
  • Loading branch information
pseudobun and martines3000 authored Apr 11, 2024
1 parent 254d15b commit 3b56e6f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,16 @@ export const RequirementDisplay = ({
const queryCredentialsResult = await api.queryCredentials();

if (isError(queryCredentialsResult)) {
useToastStore.setState({
open: true,
title: t('requirements-not-met'),
type: 'error',
loading: false,
link: null,
});
setStartedVerifying(false);
return;
}

// Create a presentation from all the user's credentials except the polygonid ones
const createPresentationResult = await api.createPresentation({
vcs: queryCredentialsResult.data.reduce((acc, queryResult) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ export const CredentialTypes = () => {
);
}}
>
clear ({credentialTypes.filter((type) => type.selected).length})
{t('clear')} (
{credentialTypes.filter((type) => type.selected).length})
</button>
) : (
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function FilterPopover({ vcs }: FilterPopoverProps) {
return;
}
vc.data.type.forEach((type: string) => {
if (type !== 'VerifiableCredential') allCredentialTypes.push(type);
// if (type !== 'VerifiableCredential')
allCredentialTypes.push(type);
});
});
const availableCredentialTypes = [...new Set(allCredentialTypes)];
Expand Down
6 changes: 2 additions & 4 deletions packages/dapp/src/components/DashboardDisplay/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,13 @@ export const filterColumnsType = (
const availableTypes = types
.filter((type) => type.selected)
.map((type) => type.type);

const filteredList = credentialList.filter((credential) => {
const { type } = credential.data;
if (!type) return false;

for (const typ of availableTypes) {
if (
(typeof type === 'string' && type === typ) ||
(Array.isArray(type) && type.indexOf(typ) >= 0)
) {
if ((typeof type === 'string' && type === typ) || Array.isArray(type)) {
return true;
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/dapp/src/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@
"rewards": "Rewards"
},
"RequirementDisplay": {
"verify": "Verify"
"verify": "Verify",
"requirements-not-met": "You do not meet the requirements"
},
"RewardDisplay": {},
"CredentialCard": {
Expand Down Expand Up @@ -365,7 +366,7 @@
"title": "Delete Shared Presentation"
},
"FilterPopover": {
"clear": "clear",
"clear": "Clear",
"datastore": "Data Store",
"ecosystem": "Ecosystem",
"filter": "Filter",
Expand Down

0 comments on commit 3b56e6f

Please sign in to comment.