From b092551885b4e3cbea0e21990c3bb20aa69ab03e Mon Sep 17 00:00:00 2001 From: PavloNetrebchuk Date: Tue, 31 Oct 2023 12:29:38 +0200 Subject: [PATCH] Minor changes --- .../dialog/appreview/ThankYouDialogFragment.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/org/openedx/core/presentation/dialog/appreview/ThankYouDialogFragment.kt b/core/src/main/java/org/openedx/core/presentation/dialog/appreview/ThankYouDialogFragment.kt index b09964a09..b64f09597 100644 --- a/core/src/main/java/org/openedx/core/presentation/dialog/appreview/ThankYouDialogFragment.kt +++ b/core/src/main/java/org/openedx/core/presentation/dialog/appreview/ThankYouDialogFragment.kt @@ -69,11 +69,13 @@ class ThankYouDialogFragment : BaseAppReviewDialogFragment() { val request = reviewManager.requestReviewFlow() request.addOnCompleteListener { task -> try { - val reviewInfo = task.result - val flow = reviewManager.launchReviewFlow(requireActivity(), reviewInfo) - flow.addOnCompleteListener { _ -> - onPositiveRate() - dismiss() + if (request.isSuccessful) { + val reviewInfo = task.result + val flow = reviewManager.launchReviewFlow(requireActivity(), reviewInfo) + flow.addOnCompleteListener { _ -> + onPositiveRate() + dismiss() + } } } catch (e: ReviewException) { e.printStackTrace()