This commit is contained in:
minibits-cash
2025-08-08 23:56:32 +02:00
parent 7522562db0
commit 959c873453
3 changed files with 10 additions and 9 deletions
+4 -4
View File
@@ -25,7 +25,7 @@ import {useHeader} from '../utils/useHeader'
import {rootStoreInstance, useStores} from '../models'
import {translate} from '../i18n'
import AppError from '../utils/AppError'
import {AuthService, Database, KeyChain} from '../services'
import {Database, KeyChain} from '../services'
import {MMKVStorage} from '../services'
import { LogLevel } from '../services/log/logTypes'
import { getSnapshot } from 'mobx-state-tree'
@@ -44,7 +44,7 @@ export const DeveloperScreen = observer(function DeveloperScreen({ route }: Prop
onLeftPress: () => navigation.goBack(),
})
const {transactionsStore, userSettingsStore, proofsStore, walletProfileStore} = useStores()
const {transactionsStore, userSettingsStore, proofsStore, walletProfileStore, authStore} = useStores()
const [isLoading, setIsLoading] = useState(false)
const [rnVersion, setRnVersion] = useState<string>('')
@@ -197,7 +197,7 @@ export const DeveloperScreen = observer(function DeveloperScreen({ route }: Prop
onPress: async () => {
try {
setIsLoading(true)
await AuthService.logout()
await authStore.logout()
setIsLoading(false)
setInfo(translate("developerScreen_jwtTokensCleared"))
} catch (e: any) {
@@ -250,7 +250,7 @@ export const DeveloperScreen = observer(function DeveloperScreen({ route }: Prop
// Clean mobx storage
MMKVStorage.clearAll()
// Reset server's jwt tokens and logout
await AuthService.logout()
await authStore.logout()
// recreate db schema
Database.getInstance()
setIsLoading(false)
+6 -4
View File
@@ -20,7 +20,7 @@ import {
} from '../components'
import {useHeader} from '../utils/useHeader'
import AppError, { Err } from '../utils/AppError'
import { AuthService, Database, KeyChain, log, MinibitsClient } from '../services'
import { Database, KeyChain, log, MinibitsClient } from '../services'
import Clipboard from '@react-native-clipboard/clipboard'
import { rootStoreInstance, useStores } from '../models'
import {MnemonicInput} from './Recovery/MnemonicInput'
@@ -35,6 +35,7 @@ import { MintsStoreSnapshot } from '../models/MintsStore'
import { ContactsStoreSnapshot } from '../models/ContactsStore'
import { CashuMint, MintActiveKeys } from '@cashu/cashu-ts'
import { StaticScreenProps, useNavigation } from '@react-navigation/native'
import { AuthStoreModel } from '../models/AuthStore'
type Props = StaticScreenProps<undefined>
@@ -54,7 +55,8 @@ export const ImportBackupScreen = observer(function ImportBackupScreen({ route }
userSettingsStore,
contactsStore,
walletProfileStore,
walletStore
walletStore,
authStore
} = useStores()
const mnemonicInputRef = useRef<TextInput>(null)
@@ -286,8 +288,8 @@ export const ImportBackupScreen = observer(function ImportBackupScreen({ route }
keys.SEED = seed
await AuthService.logout()
await AuthService.enrollDevice(
await authStore.logout()
await authStore.enrollDevice(
keys.NOSTR,
walletProfileStore.device
)
-1
View File
@@ -8,5 +8,4 @@ export * from "./logService"
export * from "./torService"
export * from "./syncQueueService"
export * from "./notificationService"
export * from "./authService"