From 359c4d7a32df9fb916de6480220691405014fd5c Mon Sep 17 00:00:00 2001 From: minibits-cash Date: Mon, 26 Jan 2026 21:35:37 +0100 Subject: [PATCH] Fix contact sync --- android/app/build.gradle | 2 +- package.json | 2 +- src/models/WalletStore.ts | 2 +- src/screens/ContactDetailScreen.tsx | 14 +++++++++----- src/screens/DeveloperScreen.tsx | 2 +- src/services/logService.ts | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 33b45cc9..4c1ba0c8 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -95,7 +95,7 @@ android { applicationId "com.minibits_wallet" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 58063 + versionCode 58064 versionName "0.3.4" } diff --git a/package.json b/package.json index f53698b4..8fac2404 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minibits_wallet", - "version": "0.3.4-beta.18", + "version": "0.3.4-beta.19", "private": true, "scripts": { "android:clean": "cd android && ./gradlew clean", diff --git a/src/models/WalletStore.ts b/src/models/WalletStore.ts index 6fe787f4..a00f6830 100644 --- a/src/models/WalletStore.ts +++ b/src/models/WalletStore.ts @@ -27,7 +27,7 @@ import { Proof } from './Proof' import { InFlightRequest, Mint } from './Mint' import { getRootStore } from './helpers/getRootStore' import { Transaction } from './Transaction' -// refresh +// refresh refresh /* Not persisted, in-memory only model of the cashu-ts wallet instances and wallet keys persisted in the device secure store. diff --git a/src/screens/ContactDetailScreen.tsx b/src/screens/ContactDetailScreen.tsx index 5e8cf315..923b0a66 100644 --- a/src/screens/ContactDetailScreen.tsx +++ b/src/screens/ContactDetailScreen.tsx @@ -57,6 +57,8 @@ export const ContactDetailScreen = observer(function ({ route }: Props) { try { if (contact.nip05) { await NostrClient.verifyNip05(contact.nip05 as string, contact.pubkey) + const contactInstance = contactsStore.findByPubkey(contact.pubkey) + contactInstance?.refreshPicture() } setSyncStatus('synced') } catch (e: any) { @@ -172,12 +174,14 @@ export const ContactDetailScreen = observer(function ({ route }: Props) { const onSyncPrivateContact = async function () { try { - if(contact.nip05) { + if(contact.nip05) { await NostrClient.verifyNip05(contact.nip05 as string, contact.pubkey) // throws - contact.refreshPicture!() + // Get the actual MST model instance from the store to call actions + const contactInstance = contactsStore.findByPubkey(contact.pubkey) + contactInstance?.refreshPicture() } - toggleContactModal() + toggleContactModal() setInfo(translate("syncCompleted")) return } catch (e: any) { @@ -185,11 +189,11 @@ export const ContactDetailScreen = observer(function ({ route }: Props) { if(Platform.OS === 'ios') { setTimeout(() => { handleError(e) - }, 500) + }, 500) } else { handleError(e) } - } + } } const saveToPrivateContacts = async function () { diff --git a/src/screens/DeveloperScreen.tsx b/src/screens/DeveloperScreen.tsx index d389cabe..91591a03 100644 --- a/src/screens/DeveloperScreen.tsx +++ b/src/screens/DeveloperScreen.tsx @@ -34,7 +34,7 @@ import RNExitApp from 'react-native-exit-app' import { TransactionStatus } from '../models/Transaction' import { maxTransactionsInHistory } from '../models/TransactionsStore' import { StaticScreenProps, useNavigation } from '@react-navigation/native' -// +// refresh type Props = StaticScreenProps diff --git a/src/services/logService.ts b/src/services/logService.ts index f1288a53..bb844a6f 100644 --- a/src/services/logService.ts +++ b/src/services/logService.ts @@ -18,7 +18,7 @@ import { Platform } from "react-native" import AppError, { Err } from "../utils/AppError" const { userSettingsStore } = rootStoreInstance -// +// if (!__DEV__) { Sentry.init({