From 4fd310cf6e5280d2beb0aa3c92e57545383570a6 Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Tue, 3 May 2022 11:42:41 +0300 Subject: [PATCH 1/2] Converting accountId and owner to lowercase for the comparison to avoid problems caused by inconsistent cases (#1377) * Showing loader on the edit formm until everything has loaded * Changing logic so that loader is the fallback * Making sure account Ids are in lowercase when comparing them * Fix crash when no account is connected --- src/components/Asset/Edit/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Asset/Edit/index.tsx b/src/components/Asset/Edit/index.tsx index b796e3aa7..99f84c006 100644 --- a/src/components/Asset/Edit/index.tsx +++ b/src/components/Asset/Edit/index.tsx @@ -37,13 +37,17 @@ export default function Edit({ uri }: { uri: string }): ReactElement { } ].filter((tab) => tab !== undefined) - return asset && asset?.accessDetails && accountId === owner ? ( + return asset && + asset?.accessDetails && + accountId?.toLowerCase() === owner?.toLowerCase() ? (
- ) : asset && asset?.accessDetails && accountId !== owner ? ( + ) : asset && + asset?.accessDetails && + accountId?.toLowerCase() !== owner?.toLowerCase() ? ( Date: Tue, 3 May 2022 06:15:39 -0400 Subject: [PATCH 2/2] added optional chaining to oceanConfig (#1380) --- src/components/Asset/Edit/FormEditMetadata.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Asset/Edit/FormEditMetadata.tsx b/src/components/Asset/Edit/FormEditMetadata.tsx index 64e6285bd..1c4461744 100644 --- a/src/components/Asset/Edit/FormEditMetadata.tsx +++ b/src/components/Asset/Edit/FormEditMetadata.tsx @@ -105,7 +105,7 @@ export default function FormEditMetadata({ } {...field} component={Input} - prefix={field.name === 'price' && oceanConfig.oceanTokenSymbol} + prefix={field.name === 'price' && oceanConfig?.oceanTokenSymbol} onChange={(e: ChangeEvent) => handleFieldChange(e, field) }