mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
Extract default credential type
This commit is contained in:
parent
1439353262
commit
9fc5de69b4
@ -46,6 +46,17 @@ const contentQuery = graphql`
|
||||
}
|
||||
`
|
||||
|
||||
function getDefaultCredentialType(credentialType: string): CredentialType {
|
||||
switch (credentialType) {
|
||||
case 'address':
|
||||
return CredentialType.address
|
||||
case 'credential3Box':
|
||||
return CredentialType.credential3Box
|
||||
default:
|
||||
return CredentialType.address
|
||||
}
|
||||
}
|
||||
|
||||
export default function EditAdvanceSettings({
|
||||
setShowEdit
|
||||
}: {
|
||||
@ -64,17 +75,7 @@ export default function EditAdvanceSettings({
|
||||
|
||||
const hasFeedback = error || success
|
||||
|
||||
let credentialType: CredentialType
|
||||
switch (appConfig.credentialType) {
|
||||
case 'address':
|
||||
credentialType = CredentialType.address
|
||||
break
|
||||
case 'credential3Box':
|
||||
credentialType = CredentialType.credential3Box
|
||||
break
|
||||
default:
|
||||
credentialType = CredentialType.address
|
||||
}
|
||||
const credentialType = getDefaultCredentialType(appConfig.credentialType)
|
||||
|
||||
async function handleSubmit(
|
||||
values: Partial<AdvanceSettingsForm>,
|
||||
|
Loading…
Reference in New Issue
Block a user