Skip to content

Commit

Permalink
fix: history display
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmanos committed Jan 8, 2025
1 parent f59f415 commit 778c119
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/History/HistoryList.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,18 @@ const HistoryList = ({ credentialId = null, history, title = '', limit = null })
}, [history, credentialId, limit]);

const handleHistoryItemClick = async (item) => {
setMatchingCredentials(item.presentation.startsWith("b64:") ? JSON.parse(new TextDecoder().decode(fromBase64(item.presentation.replace("b64:", "")))) : [ item.presentation ] );
const extractPresentations = (item) => {
if (item.presentation.startsWith("b64:") && (new TextDecoder().decode(fromBase64(item.presentation.replace("b64:", "")))).includes("[")) {
return JSON.parse(new TextDecoder().decode(fromBase64(item.presentation.replace("b64:", ""))));
}
else if (item.presentation.startsWith("b64:")) {
return [ new TextDecoder().decode(fromBase64(item.presentation.replace("b64:", ""))) ];
}
else {
return [ item.presentation ];
}
}
setMatchingCredentials(extractPresentations(item));
if (screenType === 'mobile') {
navigate(`/history/${item.id}`);
}
Expand Down

0 comments on commit 778c119

Please sign in to comment.