From b6c08e5342590ce7243c716918867b1b0113c59f Mon Sep 17 00:00:00 2001 From: Xin Liu Date: Fri, 7 Apr 2023 23:43:11 -0700 Subject: [PATCH] Fix logic for resolving .eth --- Sources/App/routes.swift | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Sources/App/routes.swift b/Sources/App/routes.swift index 78f11e1..769b808 100644 --- a/Sources/App/routes.swift +++ b/Sources/App/routes.swift @@ -192,21 +192,18 @@ func routes(_ app: Application) throws { if let resolvedAddress = try? await resolver.addr() { address = "0x" + resolvedAddress.lowercased() displayName = name - if let resolver = try? await enskit.resolver(name: name) { - if let avatar = try? await resolver.getAvatar(), - let avatarURL = try? await resolver.getAvatarImageURL(from: avatar) - { - avatarURLString = avatarURL.absoluteString - } - if let contentHashURL = try? await resolver.contenthash() { - contentHash = contentHashURL.absoluteString - } - if let juiceboxProjectIDString = try? await resolver.text( - key: "juicebox_project_id" - ) { - juiceboxProjectID = juiceboxProjectIDString - } - } + } + if let avatar = try? await resolver.getAvatar(), + let avatarURL = try? await resolver.getAvatarImageURL(from: avatar) { + avatarURLString = avatarURL.absoluteString + } + if let contentHashURL = try? await resolver.contenthash() { + contentHash = contentHashURL.absoluteString + } + if let juiceboxProjectIDString = try? await resolver.text( + key: "juicebox_project_id" + ) { + juiceboxProjectID = juiceboxProjectIDString } } }