mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-09-29 00:10:50 +00:00
Delay call to fetch profile contacts
This commit is contained in:
parent
1b3c057fcf
commit
62c9f4d114
@ -267,8 +267,10 @@ export const ProfileProvider = (props: { children: ContextChildren }) => {
|
||||
updateStore('userProfile', () => undefined);
|
||||
updateStore('userStats', () => ({ ...emptyStats }));
|
||||
getUserProfileInfo(profileKey, `profile_info_${APP_ID}`);
|
||||
getProfileContactList(profileKey, `profile_contacts_${APP_ID}`);
|
||||
getProfileScoredNotes(profileKey, `profile_scored_${APP_ID}`, 10);
|
||||
setTimeout(() => {
|
||||
getProfileContactList(profileKey, `profile_contacts_${APP_ID}`);
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,32 +75,11 @@ const Profile: Component = () => {
|
||||
}
|
||||
|
||||
const setProfile = (hex: string | undefined) => {
|
||||
// if (hex === profile?.profileKey) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
profile?.actions.setProfileKey(hex);
|
||||
profile?.actions.clearNotes();
|
||||
profile?.actions.fetchNotes(hex);
|
||||
}
|
||||
|
||||
// const react = createReaction(() => {
|
||||
// setProfile(getHex());
|
||||
// });
|
||||
|
||||
// onMount(() => {
|
||||
// // If connection doesn't exist at mount time,
|
||||
// // create a one-time reaction, when connection is established
|
||||
// // to fetch profile data.
|
||||
// if (!isConnected()) {
|
||||
// react(() => isConnected());
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // Otherwise, fetch profile data.
|
||||
// setProfile(getHex());
|
||||
// });
|
||||
|
||||
createEffect(() => {
|
||||
if (account?.isKeyLookupDone) {
|
||||
setProfile(getHex());
|
||||
|
Loading…
Reference in New Issue
Block a user