Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

Commit

Permalink
chore: optimize: followers RNS async
Browse files Browse the repository at this point in the history
  • Loading branch information
Candinya committed Sep 7, 2021
1 parent be10439 commit 01fa350
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/views/Followers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface Profile {
components: { ImgHolder, Button, FollowerCard },
})
export default class Followers extends Vue {
public followerList: Array<Object> = [];
public followerList: Array<Profile> = [];
public rss3Profile: Profile = {
avatar: config.defaultAvatar,
username: '',
Expand Down Expand Up @@ -85,11 +85,17 @@ export default class Followers extends Vue {
this.followerList.push({
avatar: profile.avatar?.[0] || config.defaultAvatar,
username: profile.name || '',
bio: profile.bio || '',
address: item,
displayAddress: this.filter(item),
rns: (await RNSUtils.addr2Name(item)).toString().replace('.pass3.me', ''),
rns: '',
});
}
setTimeout(async () => {
for (const item of this.followerList) {
item.rns = (await RNSUtils.addr2Name(item.address)).toString().replace('.pass3.me', '');
}
});
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/views/Followings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface Profile {
components: { ImgHolder, Button, FollowerCard },
})
export default class Followings extends Vue {
public followingList: Array<Object> = [];
public followingList: Array<Profile> = [];
public rss3Profile: Profile = {
avatar: config.defaultAvatar,
username: '',
Expand Down Expand Up @@ -85,11 +85,17 @@ export default class Followings extends Vue {
this.followingList.push({
avatar: profile?.avatar?.[0] || config.defaultAvatar,
username: profile?.name || '',
bio: profile.bio || '',
address: item,
displayAddress: this.filter(item),
rns: (await RNSUtils.addr2Name(item)).toString().replace('.pass3.me', ''),
rns: '',
});
}
setTimeout(async () => {
for (const item of this.followingList) {
item.rns = (await RNSUtils.addr2Name(item.address)).toString().replace('.pass3.me', '');
}
});
}
}
Expand Down

0 comments on commit 01fa350

Please sign in to comment.