Fix NostrSync error toast for accounts with no profile published yet

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
shakespeare.diy 2026-06-17 23:38:24 +07:00
parent 6e46214747
commit 0f98994c86

View file

@ -215,11 +215,17 @@ export function NostrSync() {
} else {
syncState.current.set(pubkey, false);
console.error('[NostrSync] All attempts failed for', pubkey.slice(0, 8));
toast({
title: 'Could not load profile',
description: 'Check your internet connection and try refreshing.',
variant: 'destructive',
});
// Don't show error toast if profile simply doesn't exist yet —
// it's a new account, not a connection error
if (!profileSynced) {
console.log('[NostrSync] No profile found — may be a new account');
} else {
toast({
title: 'Could not load profile',
description: 'Check your internet connection and try refreshing.',
variant: 'destructive',
});
}
}
}
}