diff --git a/CHANGELOG.md b/CHANGELOG.md index 70f0a91f1..61e2d9e88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [4.0.37] - 2024-10-29 + +### Changed +- Bump GDK to version 0.73.3 + +### Fixed +- Crash fix + ## [4.0.36] - 2024-10-24 ### Changed diff --git a/common/src/commonMain/kotlin/com/blockstream/common/models/exchange/OnOffRampsViewModel.kt b/common/src/commonMain/kotlin/com/blockstream/common/models/exchange/OnOffRampsViewModel.kt index 5eddce4d9..f624775a3 100644 --- a/common/src/commonMain/kotlin/com/blockstream/common/models/exchange/OnOffRampsViewModel.kt +++ b/common/src/commonMain/kotlin/com/blockstream/common/models/exchange/OnOffRampsViewModel.kt @@ -15,6 +15,7 @@ import com.blockstream.common.extensions.ifConnected import com.blockstream.common.extensions.isNotBlank import com.blockstream.common.extensions.isPolicyAsset import com.blockstream.common.extensions.launchIn +import com.blockstream.common.extensions.logException import com.blockstream.common.extensions.previewAccountAssetBalance import com.blockstream.common.extensions.previewWallet import com.blockstream.common.extensions.tryCatch @@ -164,7 +165,7 @@ class OnOffRampsViewModel(greenWallet: GreenWallet) : if (isLightning) { // Cache SwapInfo if (swapInfo == null) { - swapInfo = tryCatch(context = Dispatchers.Main) { + swapInfo = tryCatch(context = Dispatchers.Default) { session.receiveOnchain() } } diff --git a/compose/src/androidMain/kotlin/com/blockstream/compose/components/Buttons.android.kt b/compose/src/androidMain/kotlin/com/blockstream/compose/components/Buttons.android.kt index 466e6359f..1ed16ac98 100644 --- a/compose/src/androidMain/kotlin/com/blockstream/compose/components/Buttons.android.kt +++ b/compose/src/androidMain/kotlin/com/blockstream/compose/components/Buttons.android.kt @@ -1,6 +1,8 @@ package com.blockstream.compose.components import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Text import androidx.compose.runtime.Composable diff --git a/compose/src/commonMain/kotlin/com/blockstream/compose/screens/settings/WalletSettingsScreen.kt b/compose/src/commonMain/kotlin/com/blockstream/compose/screens/settings/WalletSettingsScreen.kt index 08c9b379c..5e22768b1 100644 --- a/compose/src/commonMain/kotlin/com/blockstream/compose/screens/settings/WalletSettingsScreen.kt +++ b/compose/src/commonMain/kotlin/com/blockstream/compose/screens/settings/WalletSettingsScreen.kt @@ -35,14 +35,12 @@ import blockstream_green.common.generated.resources.id_1d_minutes import blockstream_green.common.generated.resources.id_2fa_threshold import blockstream_green.common.generated.resources.id_a_screen_lock_must_be_enabled import blockstream_green.common.generated.resources.id_add_a_pgp_public_key_to_receive -import blockstream_green.common.generated.resources.id_another_2fa_method_is_already import blockstream_green.common.generated.resources.id_archived_accounts import blockstream_green.common.generated.resources.id_auto_logout_timeout import blockstream_green.common.generated.resources.id_backup_recovery_phrase import blockstream_green.common.generated.resources.id_biometric_login_is_disabled import blockstream_green.common.generated.resources.id_biometric_login_is_enabled import blockstream_green.common.generated.resources.id_change_pin -import blockstream_green.common.generated.resources.id_confirm_via_2fa_that_you import blockstream_green.common.generated.resources.id_copy_support_id import blockstream_green.common.generated.resources.id_denomination__exchange_rate import blockstream_green.common.generated.resources.id_display_values_in_s_and @@ -56,7 +54,6 @@ import blockstream_green.common.generated.resources.id_pgp_key import blockstream_green.common.generated.resources.id_recovery_transaction_emails import blockstream_green.common.generated.resources.id_recovery_transactions import blockstream_green.common.generated.resources.id_request_recovery_transactions -import blockstream_green.common.generated.resources.id_security_change import blockstream_green.common.generated.resources.id_set_an_email_for_recovery import blockstream_green.common.generated.resources.id_set_twofactor_threshold import blockstream_green.common.generated.resources.id_support @@ -77,7 +74,6 @@ import com.blockstream.common.data.TwoFactorSetupAction import com.blockstream.common.data.WalletSetting import com.blockstream.common.events.Events import com.blockstream.common.gdk.data.Network -import com.blockstream.common.gdk.data.TwoFactorConfig import com.blockstream.common.models.settings.DenominationExchangeRateViewModel import com.blockstream.common.models.settings.WalletSettingsSection import com.blockstream.common.models.settings.WalletSettingsViewModel @@ -85,7 +81,6 @@ import com.blockstream.common.models.settings.WalletSettingsViewModelAbstract import com.blockstream.common.navigation.NavigateDestinations import com.blockstream.common.sideeffects.SideEffects import com.blockstream.common.utils.getBitcoinOrLiquidUnit -import com.blockstream.compose.components.GreenAmountField import com.blockstream.compose.components.GreenButton import com.blockstream.compose.components.GreenButtonType import com.blockstream.compose.components.GreenColumn @@ -145,6 +140,7 @@ fun WalletSettingsScreen( var showAutologoutTimeoutDialog by remember { mutableStateOf(null) } var showThresholdDialog by remember { mutableStateOf(null) } var showTwoFactorChangeDialog by remember { mutableStateOf(null) } + val onProgress by viewModel.onProgress.collectAsStateWithLifecycle() val biometricsState = rememberBiometricsState() @@ -421,11 +417,14 @@ fun WalletSettingsScreen( } ), checked = item.enabled, + enabled = !onProgress, onCheckedChange = { viewModel.postEvent(WalletSettingsViewModel.LocalEvents.LoginWithBiometrics) }, modifier = Modifier.clickable { - viewModel.postEvent(WalletSettingsViewModel.LocalEvents.LoginWithBiometrics) + if (!onProgress) { + viewModel.postEvent(WalletSettingsViewModel.LocalEvents.LoginWithBiometrics) + } } ) } @@ -566,6 +565,7 @@ fun Setting( painter: Painter? = null, checked: Boolean? = null, isRadio: Boolean = false, + enabled: Boolean = true, onCheckedChange: ((Boolean) -> Unit) = {}, ) { Card(modifier = Modifier.then(modifier)) { @@ -607,6 +607,7 @@ fun Setting( if (isRadio) { RadioButton( selected = checked, + enabled = enabled, onClick = { onCheckedChange.invoke(true) }, @@ -618,6 +619,7 @@ fun Setting( Switch( checked = checked, onCheckedChange = onCheckedChange, + enabled = enabled, modifier = Modifier .align(Alignment.CenterVertically) .padding(end = 16.dp) diff --git a/compose/src/commonMain/kotlin/com/blockstream/compose/sideeffects/Dialog.kt b/compose/src/commonMain/kotlin/com/blockstream/compose/sideeffects/Dialog.kt index 6291970d3..96a45492f 100644 --- a/compose/src/commonMain/kotlin/com/blockstream/compose/sideeffects/Dialog.kt +++ b/compose/src/commonMain/kotlin/com/blockstream/compose/sideeffects/Dialog.kt @@ -85,7 +85,7 @@ class DialogState { openDialog( OpenDialogData( title = StringHolder.create(Res.string.id_error), - message = StringHolder.create(throwable.message), + message = StringHolder.create(throwable.message ?: throwable.cause?.message), onDismiss = onClose, onPrimary = onClose, secondaryText = getString(Res.string.id_contact_support) diff --git a/compose/src/commonMain/kotlin/com/blockstream/compose/utils/SideEffects.kt b/compose/src/commonMain/kotlin/com/blockstream/compose/utils/SideEffects.kt index 554981658..36d5bb3db 100644 --- a/compose/src/commonMain/kotlin/com/blockstream/compose/utils/SideEffects.kt +++ b/compose/src/commonMain/kotlin/com/blockstream/compose/utils/SideEffects.kt @@ -323,8 +323,8 @@ fun HandleSideEffect( is SideEffects.ErrorDialog -> { appCoroutine.launch { dialog.openErrorDialog( - it.error, - it.errorReport, + throwable = it.error, + errorReport = it.errorReport, onErrorReport = { errorReport -> appCoroutine.launch { dialog.openErrorReportDialog( diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 20fae4ad1..38aae01b2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -21,7 +21,7 @@ constraintlayout = "2.1.4" appcompat = "1.7.0" core-ktx = "1.13.1" core-testing = "2.2.0" -countly-sdk-android = "cfa75ab5bfba362ecb53c9d6e2b513cdabd8e1a5" +countly-sdk-android = "9c9811144bcf70da8d8fcb8eab8389c09405b188" espresso-core = "3.6.1" fastadapter = "5.7.0" installreferrer = "2.2" diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 807ecec1d..d2955948d 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -7948,6 +7948,11 @@ + + + + + @@ -7956,6 +7961,11 @@ + + + + + @@ -7969,6 +7979,11 @@ + + + + + @@ -7977,6 +7992,11 @@ + + + + + @@ -7990,6 +8010,11 @@ + + + + + @@ -7998,6 +8023,11 @@ + + + + + @@ -8011,6 +8041,11 @@ + + + + + @@ -8019,6 +8054,11 @@ + + + + + diff --git a/green/build.gradle.kts b/green/build.gradle.kts index 7e1dc07f5..858583512 100644 --- a/green/build.gradle.kts +++ b/green/build.gradle.kts @@ -42,8 +42,8 @@ android { defaultConfig { minSdk = libs.versions.androidMinSdk.get().toInt() targetSdk = libs.versions.androidTargetSdk.get().toInt() - versionCode = 436 - versionName = "4.0.36" + versionCode = 437 + versionName = "4.0.37" setProperty("archivesBaseName", "BlockstreamGreen-v$versionName") proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")