From c8a1ffcd4e9d69545905d9b2645ad49131df85dd Mon Sep 17 00:00:00 2001 From: ThomazFB Date: Tue, 9 Apr 2024 11:04:26 -0300 Subject: [PATCH 1/2] Block the Troubleshooting banner to be presented at the same as the Feature announcement --- .../android/ui/orders/list/OrderListViewModel.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/OrderListViewModel.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/OrderListViewModel.kt index 36072977029..89b068edbbf 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/OrderListViewModel.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/OrderListViewModel.kt @@ -185,7 +185,8 @@ class OrderListViewModel @Inject constructor( get() { val simplePaymentsAndOrderFeedbackDismissed = simplePaymentsAndOrderCreationFeedbackState == FeatureFeedbackSettings.FeedbackState.DISMISSED - return !simplePaymentsAndOrderFeedbackDismissed + val isTroubleshootingBannerVisible = viewState.shouldDisplayTroubleshootingBanner + return !simplePaymentsAndOrderFeedbackDismissed && !isTroubleshootingBannerVisible } init { @@ -256,6 +257,13 @@ class OrderListViewModel @Inject constructor( activatePagedListWrapper(pagedListWrapper, isFirstInit = true) } + fun changeTroubleshootingBannerVisibility(show: Boolean) { + viewState = viewState.copy( + shouldDisplayTroubleshootingBanner = show, + isSimplePaymentsAndOrderCreationFeedbackVisible = !show + ) + } + /** * Removes the `#` from the start of the search keyword, if present. * @@ -449,9 +457,7 @@ class OrderListViewModel @Inject constructor( triggerEvent(RetryLoadingOrders) } - else -> viewState = viewState.copy( - shouldDisplayTroubleshootingBanner = true - ) + else -> changeTroubleshootingBannerVisibility(show = true) } noTimeoutHappened = false } From df7315a363ed02d42c9529ed4489a14ff937b83f Mon Sep 17 00:00:00 2001 From: ThomazFB Date: Tue, 9 Apr 2024 11:04:52 -0300 Subject: [PATCH 2/2] Trigger visibility changes when the Troubleshooting banner receives interactions --- .../woocommerce/android/ui/orders/list/OrderListFragment.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/OrderListFragment.kt b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/OrderListFragment.kt index 463326f0d87..33fd8ddd5a2 100644 --- a/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/OrderListFragment.kt +++ b/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/list/OrderListFragment.kt @@ -997,8 +997,12 @@ class OrderListFragment : show = show, title = getString(R.string.orderlist_timeout_error_title), message = getString(R.string.orderlist_timeout_error_message), - supportContactClick = { openSupportRequestScreen() }, + supportContactClick = { + viewModel.changeTroubleshootingBannerVisibility(show = false) + openSupportRequestScreen() + }, troubleshootingClick = { + viewModel.changeTroubleshootingBannerVisibility(show = false) viewModel.trackConnectivityTroubleshootClicked() openConnectivityTool() }