From a256a04154f700b87e22fd93820d5c89a465a2c2 Mon Sep 17 00:00:00 2001 From: andrew Date: Wed, 29 Nov 2023 11:57:03 +1030 Subject: [PATCH] Fix QR code --- .../RecoveryPasswordViewModel.kt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/onboarding/recoverypassword/RecoveryPasswordViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/onboarding/recoverypassword/RecoveryPasswordViewModel.kt index f2a517645..1898912b1 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/onboarding/recoverypassword/RecoveryPasswordViewModel.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/onboarding/recoverypassword/RecoveryPasswordViewModel.kt @@ -18,19 +18,19 @@ class RecoveryPasswordViewModel @Inject constructor( private val application: Application ): AndroidViewModel(application) { - val qrBitmap: Bitmap? = TextSecurePreferences.getLocalNumber(application)?.let { - QRCodeUtilities.encode( - data = it, - size = toPx(280, application.resources), - isInverted = false, - hasTransparentBackground = true - ) - } - val seed by lazy { val hexEncodedSeed = IdentityKeyUtil.retrieve(application, IdentityKeyUtil.LOKI_SEED) ?: IdentityKeyUtil.getIdentityKeyPair(application).hexEncodedPrivateKey // Legacy account MnemonicCodec { MnemonicUtilities.loadFileContents(application, it) } .encode(hexEncodedSeed, MnemonicCodec.Language.Configuration.english) } + + val qrBitmap by lazy { + QRCodeUtilities.encode( + data = seed, + size = toPx(280, application.resources), + isInverted = false, + hasTransparentBackground = true + ) + } }