Skip to content

Commit

Permalink
Remove stories beta dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-signal committed Oct 24, 2022
1 parent 428ab65 commit 064f7ab
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import io.reactivex.rxjava3.core.Observable
import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.groups.SelectionLimits
import org.thoughtcrime.securesms.keyvalue.SignalStore
import org.thoughtcrime.securesms.stories.dialogs.StoryDialogs
import org.thoughtcrime.securesms.stories.settings.custom.PrivateStorySettingsFragment
import org.thoughtcrime.securesms.stories.settings.my.MyStorySettingsFragment
import org.thoughtcrime.securesms.stories.settings.privacy.ChooseInitialMyStoryMembershipBottomSheetDialogFragment
Expand Down Expand Up @@ -100,17 +99,6 @@ class ContactSearchMediator(
}

private fun toggleStorySelection(view: View, contactSearchData: ContactSearchData.Story, isSelected: Boolean) {
if (SignalStore.storyValues().userHasSeenBetaDialog) {
performStoryToggle(view, contactSearchData, isSelected)
} else {
StoryDialogs.displayBetaDialog(view.context) {
SignalStore.storyValues().userHasSeenBetaDialog = true
performStoryToggle(view, contactSearchData, isSelected)
}
}
}

private fun performStoryToggle(view: View, contactSearchData: ContactSearchData.Story, isSelected: Boolean) {
if (contactSearchData.recipient.isMyStory && !SignalStore.storyValues().userHasBeenNotifiedAboutStories) {
ChooseInitialMyStoryMembershipBottomSheetDialogFragment.show(fragment.childFragmentManager)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ internal class StoryValues(store: KeyValueStore) : SignalStoreValues(store) {
*/
private const val USER_HAS_READ_ONBOARDING_STORY = "stories.user.has.read.onboarding"

/**
* Marks whether the user has seen the beta dialog
*/
private const val USER_HAS_SEEN_BETA_DIALOG = "stories.user.has.seen.beta.dialog"

/**
* Whether or not the user will send and receive viewed receipts for stories
*/
Expand All @@ -65,10 +60,8 @@ internal class StoryValues(store: KeyValueStore) : SignalStoreValues(store) {
USER_HAS_ADDED_TO_A_STORY,
USER_HAS_SEEN_FIRST_NAV_VIEW,
HAS_DOWNLOADED_ONBOARDING_STORY,
USER_HAS_SEEN_BETA_DIALOG,
STORY_VIEWED_RECEIPTS,
USER_HAS_VIEWED_ONBOARDING_STORY,
USER_HAS_READ_ONBOARDING_STORY,
USER_HAS_SEEN_BETA_DIALOG,
STORY_VIEWED_RECEIPTS
)

Expand All @@ -86,8 +79,6 @@ internal class StoryValues(store: KeyValueStore) : SignalStoreValues(store) {

var userHasReadOnboardingStory: Boolean by booleanValue(USER_HAS_READ_ONBOARDING_STORY, false)

var userHasSeenBetaDialog: Boolean by booleanValue(USER_HAS_SEEN_BETA_DIALOG, false)

var viewedReceiptsEnabled: Boolean by booleanValue(STORY_VIEWED_RECEIPTS, false)

fun isViewedReceiptsStateSet(): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@ object StoryDialogs {
.show()
}

fun displayBetaDialog(context: Context, onConfirmed: () -> Unit) {
MaterialAlertDialogBuilder(context)
.setTitle(R.string.StoryDialogs__stories_is_available_to)
.setMessage(R.string.StoryDialogs__if_you_share_a_story)
.setPositiveButton(R.string.Permissions_continue) { _, _ -> onConfirmed() }
.setNegativeButton(android.R.string.cancel) { _, _ -> }
.show()
}

fun resendStory(context: Context, onDismiss: () -> Unit = {}, resend: () -> Unit) {
MaterialAlertDialogBuilder(context)
.setMessage(R.string.StoryDialogs__story_could_not_be_sent)
Expand Down

0 comments on commit 064f7ab

Please sign in to comment.