diff --git a/Sources/Clients/GatewayAPI/GatewayAPI+Utils.swift b/Sources/Clients/GatewayAPI/GatewayAPI+Utils.swift index f835d91803..ab188bb765 100644 --- a/Sources/Clients/GatewayAPI/GatewayAPI+Utils.swift +++ b/Sources/Clients/GatewayAPI/GatewayAPI+Utils.swift @@ -61,6 +61,18 @@ extension GatewayAPI.EntityMetadataItemValue { typed?.urlArrayValue?.values.compactMap(URL.init) } + public var asOriginCollection: [URL]? { + typed?.originArrayValue?.values.compactMap(URL.init) + } + + public var asGlobalAddress: String? { + typed?.globalAddressValue?.value + } + + public var asGlobalAddressCollection: [String]? { + typed?.globalAddressArrayValue?.values + } + public var publicKeyHashes: [GatewayAPI.PublicKeyHash]? { typed?.publicKeyHashArrayValue?.values } @@ -84,19 +96,19 @@ extension GatewayAPI.EntityMetadataCollection { } public var dappDefinition: String? { - items[.dappDefinition]?.asString + items[.dappDefinition]?.asGlobalAddress } public var dappDefinitions: [String]? { - items[.dappDefinitions]?.asStringCollection + items[.dappDefinitions]?.asGlobalAddressCollection } public var claimedEntities: [String]? { - items[.claimedEntities]?.asStringCollection + items[.claimedEntities]?.asGlobalAddressCollection } public var claimedWebsites: [URL]? { - items[.claimedWebsites]?.asURLCollection + items[.claimedWebsites]?.asOriginCollection } public var accountType: AccountType? { diff --git a/Sources/Features/AuthorizedDAppsFeature/DappDetails/DappDetails+View.swift b/Sources/Features/AuthorizedDAppsFeature/DappDetails/DappDetails+View.swift index 683a3b8adc..e00c8d0b37 100644 --- a/Sources/Features/AuthorizedDAppsFeature/DappDetails/DappDetails+View.swift +++ b/Sources/Features/AuthorizedDAppsFeature/DappDetails/DappDetails+View.swift @@ -129,11 +129,11 @@ extension DappDetails.View { if let domain = viewStore.domain { Text(L10n.AuthorizedDapps.DAppDetails.website) .sectionHeading - // FIXME: Update -// Button(domain.stringValue) { -// viewStore.send(.openURLTapped(domain)) -// } -// .buttonStyle(.url) + + Button(domain.absoluteString) { + viewStore.send(.openURLTapped(domain)) + } + .buttonStyle(.url) } } .padding(.horizontal, .medium1)