Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dapp): campaign verify failed popup #619

Merged
merged 3 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
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
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