Skip to content

Commit

Permalink
Merge pull request #20395 from wordpress-mobile/feature/remove-in-app…
Browse files Browse the repository at this point in the history
…-reviews-config

Remove feature config for in app reviews
  • Loading branch information
notandyvee authored Mar 6, 2024
2 parents c422603 + 75b8d06 commit 7823b4d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 29 deletions.
1 change: 0 additions & 1 deletion WordPress/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ android {
buildConfigField "boolean", "PLANS_IN_SITE_CREATION", "false"
buildConfigField "boolean", "READER_IMPROVEMENTS", "false"
buildConfigField "boolean", "BLOGANUARY_DASHBOARD_NUDGE", "false"
buildConfigField "boolean", "IN_APP_REVIEWS", "false"
buildConfigField "boolean", "DYNAMIC_DASHBOARD_CARDS", "false"
buildConfigField "boolean", "STATS_TRAFFIC_TAB", "false"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import org.wordpress.android.ui.prefs.AppPrefsWrapper
import org.wordpress.android.util.config.InAppReviewsFeatureConfig
import org.wordpress.android.viewmodel.Event
import javax.inject.Inject

class ReviewViewModel @Inject constructor(
private val appPrefsWrapper: AppPrefsWrapper,
private val inAppReviewsFeatureConfig: InAppReviewsFeatureConfig
) : ViewModel() {
class ReviewViewModel @Inject constructor(private val appPrefsWrapper: AppPrefsWrapper) : ViewModel() {
private val _launchReview = MutableLiveData<Event<Unit>>()
val launchReview = _launchReview as LiveData<Event<Unit>>

fun onPublishingPost(isFirstTimePublishing: Boolean) {
if (inAppReviewsFeatureConfig.isEnabled() && !appPrefsWrapper.isInAppReviewsShown() && isFirstTimePublishing) {
if (!appPrefsWrapper.isInAppReviewsShown() && isFirstTimePublishing) {
if (appPrefsWrapper.getPublishedPostCount() < TARGET_COUNT_POST_PUBLISHED) {
appPrefsWrapper.incrementPublishedPostCount()
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import org.mockito.junit.MockitoJUnitRunner
import org.mockito.kotlin.whenever
import org.wordpress.android.eventToList
import org.wordpress.android.ui.prefs.AppPrefsWrapper
import org.wordpress.android.util.config.InAppReviewsFeatureConfig
import kotlin.test.assertEquals

@RunWith(MockitoJUnitRunner::class)
Expand All @@ -19,9 +18,6 @@ class ReviewViewModelTest {
@JvmField
val rule = InstantTaskExecutorRule()

@Mock
lateinit var inAppReviewsFeatureConfig: InAppReviewsFeatureConfig

@Mock
lateinit var appPrefsWrapper: AppPrefsWrapper

Expand All @@ -31,8 +27,7 @@ class ReviewViewModelTest {

@Before
fun setup() {
whenever(inAppReviewsFeatureConfig.isEnabled()).thenReturn(true)
viewModel = ReviewViewModel(appPrefsWrapper, inAppReviewsFeatureConfig)
viewModel = ReviewViewModel(appPrefsWrapper)
events = mutableListOf()
events = viewModel.launchReview.eventToList()
}
Expand Down

0 comments on commit 7823b4d

Please sign in to comment.