Skip to content

Commit

Permalink
fix(dapp): capitalize store names on create credential page (#621)
Browse files Browse the repository at this point in the history
Signed-off-by: Urban Vidovič <[email protected]>
  • Loading branch information
pseudobun authored Apr 11, 2024
1 parent 5e589a8 commit 25ac43e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions packages/dapp/src/components/CreateCredentialDisplay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import ToggleSwitch from '@/components/Switch';
import { useMascaStore, useToastStore } from '@/stores';
import DropdownMultiselect from '../DropdownMultiselect';
import VCModal from '../VCModal';
import { capitalizeString } from '@/utils/format';

const proofFormats: Record<string, SupportedProofFormats> = {
JWT: 'jwt',
Expand Down Expand Up @@ -139,7 +140,9 @@ const CreateCredentialDisplay = () => {
proofFormat: proofFormats[format],
options: {
save,
store: selectedItems, // TODO: fix this doesn't create new credential
store: selectedItems.map((store) =>
store.toLowerCase()
) as AvailableCredentialStores[],
},
});

Expand Down Expand Up @@ -259,8 +262,14 @@ const CreateCredentialDisplay = () => {
</span>
<div className="flex flex-1">
<DropdownMultiselect
items={availableStores}
selectedItems={selectedItems}
items={availableStores.map((store) =>
capitalizeString(store)
)}
selectedItems={
selectedItems.map((store) =>
capitalizeString(store)
) as AvailableCredentialStores[]
}
setSelectedItems={setSelectedItems}
placeholder={t('save.select-storage-placeholder')}
name="storage"
Expand Down

0 comments on commit 25ac43e

Please sign in to comment.