Skip to content

Commit

Permalink
fix load address without dns (#13)
Browse files Browse the repository at this point in the history
* fix address with no dns
  • Loading branch information
modship authored Jun 28, 2024
1 parent c37208f commit 078aeda
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 0 additions & 2 deletions frontend/src/ExplorerApiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export class ExplorerApiClient {
resolve(response.data[address]);
})
.catch((error) => {
console.error(error);
reject(error);
});
});
Expand All @@ -37,7 +36,6 @@ export class ExplorerApiClient {
resolve(response.data);
})
.catch((error) => {
console.error(error);
reject(error);
});
});
Expand Down
19 changes: 10 additions & 9 deletions frontend/src/utils/write-mns-sc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -328,16 +328,17 @@ 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,
});
}
}
}

Expand Down

0 comments on commit 078aeda

Please sign in to comment.