Skip to content

Commit

Permalink
fix(friends): friends not showing on initial load
Browse files Browse the repository at this point in the history
  • Loading branch information
retrouser955 committed Sep 27, 2024
1 parent 4851956 commit a08f333
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/hooks/user/helpers/Base/PeerUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,20 @@ export async function getRawUser(alias: string, gun: IGunInstance) {
gun.get(`~${alias}`).once((d) => {
if (isFromPub) {
clear();
resolve(d);
return;
if(!d) {
gun.get(`~${alias}`).once(data => {
if(!data) {
clear()
reject("no users found")
}
clear()
resolve(data)
})
} else {
clear();
resolve(d);
return;
}
}
gun.get(Object.keys(d._['>'])[0]).once((user) => {
clear();
Expand Down

0 comments on commit a08f333

Please sign in to comment.