Fix profile creation bugs
- platformWriteSeed (Android + iOS) invoked onSeedWritten twice on success, doubling wallet switch/navigation and navigating from the IO dispatcher; keep only the main-thread invocation. - Gate profile event creation on the seed actually being written to disk: writeSeed now reports success/error, so a failed seed write no longer leaves orphaned unsigned events the notary can never sign. - Stop rethrowing from createAccount's CoroutineExceptionHandler (crashed the app); failures now show the Error state and reset the pending flag instead of spinning forever. Add a re-entry guard against double taps. - Reset WritingSeedState after a completed attempt so retries are not silently skipped, and record WrittenToDisk on success. - Derive the nostr key with NodeParamsManager.chain instead of a hardcoded Chain.Mainnet. - Build the SearchRelayListEvent from DefaultSearchRelayList instead of DM relays, and drop its empty privateTags array that caused a pointless NIP-44 encrypted empty list in content. - Compare pubKey, privateTags and signedAt in UnsignedNostrEvent equals/hashCode so distinctUntilChanged cannot conflate rows. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -124,7 +124,6 @@ actual fun platformWriteSeed(
|
||||
val newSeedMap = existingSeeds + (newWalletId to mnemonics)
|
||||
val encrypted = EncryptedSeed.V2.encrypt(newSeedMap)
|
||||
SeedManager.writeSeedToDisk(phoenixGlobal, encrypted, overwrite = true)
|
||||
onSeedWritten.invoke(newWalletId)
|
||||
if (isRestoringWallet) {
|
||||
log.i("successfully restored wallet=$newWalletId")
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user