From 25ac43e784cdf17d62ff67367eeb4e08a01b3b6d Mon Sep 17 00:00:00 2001 From: Urban Date: Thu, 11 Apr 2024 10:49:14 +0200 Subject: [PATCH] fix(dapp): capitalize store names on create credential page (#621) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Urban Vidovič --- .../components/CreateCredentialDisplay/index.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/dapp/src/components/CreateCredentialDisplay/index.tsx b/packages/dapp/src/components/CreateCredentialDisplay/index.tsx index 1942c4aea..294b963a0 100644 --- a/packages/dapp/src/components/CreateCredentialDisplay/index.tsx +++ b/packages/dapp/src/components/CreateCredentialDisplay/index.tsx @@ -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 = { JWT: 'jwt', @@ -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[], }, }); @@ -259,8 +262,14 @@ const CreateCredentialDisplay = () => {
+ capitalizeString(store) + )} + selectedItems={ + selectedItems.map((store) => + capitalizeString(store) + ) as AvailableCredentialStores[] + } setSelectedItems={setSelectedItems} placeholder={t('save.select-storage-placeholder')} name="storage"