Skip to content

Commit

Permalink
Fix logic for resolving .eth
Browse files Browse the repository at this point in the history
  • Loading branch information
livid committed Apr 8, 2023
1 parent 39ff3ca commit b6c08e5
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions Sources/App/routes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit b6c08e5

Please sign in to comment.