Skip to content

Commit

Permalink
fix address with no dns
Browse files Browse the repository at this point in the history
  • Loading branch information
modship committed Jun 28, 2024
1 parent c37208f commit f5509c6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
10 changes: 4 additions & 6 deletions frontend/src/ExplorerApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ export class ExplorerApiClient {
.then((response) => {
resolve(response.data[address]);
})
.catch((error) => {
console.error(error);
reject(error);
.catch((_error) => {
reject("error getting domain owned by address");
});
});
}
Expand All @@ -36,9 +35,8 @@ export class ExplorerApiClient {
.then((response) => {
resolve(response.data);
})
.catch((error) => {
console.error(error);
reject(error);
.catch((_error) => {
reject("error getting domains info");
});
});
}
Expand Down
20 changes: 11 additions & 9 deletions frontend/src/utils/write-mns-sc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,21 @@ export function useWriteMNS(client?: Client) {
let list: DnsUserEntryListResult[] = [];

let domains = await explorerApi.getDomainOwnedByAddress(params.address);
if (domains && domains.length > 0) {
let dnsInfos = await explorerApi.getDomainsInfo(domains);

let dnsInfos = await explorerApi.getDomainsInfo(domains);

for (const domain in dnsInfos) {
if (Object.prototype.hasOwnProperty.call(dnsInfos, domain)) {
list.push({
domain: domain,
targetAddress: dnsInfos[domain].target_address,
tokenId: dnsInfos[domain].tokenId,
});
for (const domain in dnsInfos) {
if (Object.prototype.hasOwnProperty.call(dnsInfos, domain)) {
list.push({
domain: domain,
targetAddress: dnsInfos[domain].target_address,
tokenId: dnsInfos[domain].tokenId,
});
}
}
}


setList(list);
setListSpinning(false);
return list;
Expand Down

0 comments on commit f5509c6

Please sign in to comment.