mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-01 17:31:13 +00:00
Modify profile loading
This commit is contained in:
parent
914a8ec866
commit
a12bfc573d
@ -439,6 +439,14 @@ export function AccountProvider(props: { children: JSXElement }) {
|
||||
|
||||
if (storedKey) {
|
||||
setPublicKey(storedKey);
|
||||
|
||||
// Read profile from storage
|
||||
const storedUser = getStoredProfile(storedKey);
|
||||
|
||||
if (storedUser) {
|
||||
// If it exists, set it as active user
|
||||
updateStore('activeUser', () => ({...storedUser}));
|
||||
}
|
||||
}
|
||||
|
||||
if (nostr === undefined) {
|
||||
@ -477,7 +485,6 @@ export function AccountProvider(props: { children: JSXElement }) {
|
||||
else {
|
||||
if (key !== storedKey) {
|
||||
setPublicKey(key);
|
||||
}
|
||||
|
||||
// Read profile from storage
|
||||
const storedUser = getStoredProfile(key);
|
||||
@ -486,6 +493,7 @@ export function AccountProvider(props: { children: JSXElement }) {
|
||||
// If it exists, set it as active user
|
||||
updateStore('activeUser', () => ({...storedUser}));
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch it anyway, maybe there is an update
|
||||
getUserProfiles([key], `user_profile_${APP_ID}`);
|
||||
|
Loading…
Reference in New Issue
Block a user