|
|
|
@ -20,6 +20,7 @@ export const ensureUser = (hexpubkey: string): Writable<UserObject> => { |
|
|
|
|
|
|
|
|
|
|
|
users[hexpubkey] = writable(base) |
|
|
|
users[hexpubkey] = writable(base) |
|
|
|
getUserRelays(hexpubkey) |
|
|
|
getUserRelays(hexpubkey) |
|
|
|
|
|
|
|
const getProfile = () => { |
|
|
|
u.fetchProfile({ |
|
|
|
u.fetchProfile({ |
|
|
|
closeOnEose: true, |
|
|
|
closeOnEose: true, |
|
|
|
groupable: true, |
|
|
|
groupable: true, |
|
|
|
@ -41,6 +42,22 @@ export const ensureUser = (hexpubkey: string): Writable<UserObject> => { |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
let attempts = 1 |
|
|
|
|
|
|
|
const tryAgainin3s = () => { |
|
|
|
|
|
|
|
setTimeout( |
|
|
|
|
|
|
|
() => { |
|
|
|
|
|
|
|
if (!get(users[hexpubkey]).profile) { |
|
|
|
|
|
|
|
getProfile() |
|
|
|
|
|
|
|
attempts++ |
|
|
|
|
|
|
|
if (attempts < 5) tryAgainin3s() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
(attempts ^ 2) * 1000 |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
getProfile() |
|
|
|
|
|
|
|
tryAgainin3s() |
|
|
|
|
|
|
|
} |
|
|
|
return users[hexpubkey] |
|
|
|
return users[hexpubkey] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|