1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-30 22:01:44 +02:00

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
This commit is contained in:
Jamie Hewitt 2022-05-03 11:42:41 +03:00 committed by GitHub
parent 2107eab979
commit 4fd310cf6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() ? (
<Page title={pageTitle} noPageHeader uri={uri}>
<div className={styles.container}>
<Tabs items={tabs} defaultIndex={0} className={styles.edit} />
</div>
</Page>
) : asset && asset?.accessDetails && accountId !== owner ? (
) : asset &&
asset?.accessDetails &&
accountId?.toLowerCase() !== owner?.toLowerCase() ? (
<Page title={pageTitle} noPageHeader uri={uri}>
<Alert
title="Edit action available only to asset owner"