Skip to content

Commit

Permalink
fix: vc import bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudobun committed Oct 19, 2023
1 parent b93f64a commit 8e470e2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
33 changes: 27 additions & 6 deletions packages/dapp/src/components/Controlbar/Controlbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,15 @@ const Controlbar = () => {
});

if (isError(res)) {
console.log('error', res);
setTimeout(() => {
useToastStore.setState({
open: true,
title: res.error,
type: 'error',
loading: false,
link: null,
});
}, 200);
return false;
}

Expand All @@ -112,14 +120,27 @@ const Controlbar = () => {
} as QueryCredentialsRequestResult;
newVcs.push(finalVC);
});
changeVcs(
[...vcs, ...newVcs].map((modifyVC) =>
stringifyCredentialSubject(modifyVC)
)
);

setTimeout(() => {
useToastStore.setState({
open: true,
title: t('save-success'),
type: 'success',
loading: false,
link: null,
});
}, 200);
const queryResult = await api.queryCredentials();
if (isError(queryResult)) {
setTimeout(() => {
useToastStore.setState({
open: true,
title: t('query-error'),
type: 'error',
loading: false,
link: null,
});
}, 200);
return false;
}

Expand Down
4 changes: 3 additions & 1 deletion packages/dapp/src/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@
"query": "Querying credentials",
"query-error": "Failed to query credentials",
"query-success": "Successfully queried credentials",
"save-error": "Failed to save credential. VC was invalid"
"save-error": "Failed to save credential. VC was invalid",
"save-error-title": "Failed to save credential",
"save-success": "Successfully saved credential"
},
"CreateConnectionModal": {
"desc": " Scan this QR code with your mobile device to create a connection to this page.",
Expand Down

0 comments on commit 8e470e2

Please sign in to comment.