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

Commit 01fa350

Browse files
committed
chore: optimize: followers RNS async
1 parent be10439 commit 01fa350

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/views/Followers.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ interface Profile {
5050
components: { ImgHolder, Button, FollowerCard },
5151
})
5252
export default class Followers extends Vue {
53-
public followerList: Array<Object> = [];
53+
public followerList: Array<Profile> = [];
5454
public rss3Profile: Profile = {
5555
avatar: config.defaultAvatar,
5656
username: '',
@@ -85,11 +85,17 @@ export default class Followers extends Vue {
8585
this.followerList.push({
8686
avatar: profile.avatar?.[0] || config.defaultAvatar,
8787
username: profile.name || '',
88+
bio: profile.bio || '',
8889
address: item,
8990
displayAddress: this.filter(item),
90-
rns: (await RNSUtils.addr2Name(item)).toString().replace('.pass3.me', ''),
91+
rns: '',
9192
});
9293
}
94+
setTimeout(async () => {
95+
for (const item of this.followerList) {
96+
item.rns = (await RNSUtils.addr2Name(item.address)).toString().replace('.pass3.me', '');
97+
}
98+
});
9399
}
94100
}
95101

src/views/Followings.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ interface Profile {
5050
components: { ImgHolder, Button, FollowerCard },
5151
})
5252
export default class Followings extends Vue {
53-
public followingList: Array<Object> = [];
53+
public followingList: Array<Profile> = [];
5454
public rss3Profile: Profile = {
5555
avatar: config.defaultAvatar,
5656
username: '',
@@ -85,11 +85,17 @@ export default class Followings extends Vue {
8585
this.followingList.push({
8686
avatar: profile?.avatar?.[0] || config.defaultAvatar,
8787
username: profile?.name || '',
88+
bio: profile.bio || '',
8889
address: item,
8990
displayAddress: this.filter(item),
90-
rns: (await RNSUtils.addr2Name(item)).toString().replace('.pass3.me', ''),
91+
rns: '',
9192
});
9293
}
94+
setTimeout(async () => {
95+
for (const item of this.followingList) {
96+
item.rns = (await RNSUtils.addr2Name(item.address)).toString().replace('.pass3.me', '');
97+
}
98+
});
9399
}
94100
}
95101

0 commit comments

Comments
 (0)