Allow retries for redemption from server failure. Add internal preference to enqueue job.

This commit is contained in:
Alex Hart
2021-11-04 14:05:40 -03:00
committed by Greyson Parrelli
parent 0bac08dcc4
commit 00a8565e91
4 changed files with 31 additions and 4 deletions

View File

@@ -24,8 +24,11 @@ import org.thoughtcrime.securesms.jobs.RefreshOwnProfileJob
import org.thoughtcrime.securesms.jobs.RemoteConfigRefreshJob
import org.thoughtcrime.securesms.jobs.RotateProfileKeyJob
import org.thoughtcrime.securesms.jobs.StorageForcePushJob
import org.thoughtcrime.securesms.jobs.SubscriptionReceiptRequestResponseJob
import org.thoughtcrime.securesms.keyvalue.SignalStore
import org.thoughtcrime.securesms.payments.DataExportUtil
import org.thoughtcrime.securesms.util.ConversationUtil
import org.thoughtcrime.securesms.util.FeatureFlags
import org.thoughtcrime.securesms.util.concurrent.SimpleTask
class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__internal_preferences) {
@@ -317,6 +320,17 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
}
)
}
if (FeatureFlags.donorBadges() && SignalStore.donationsValues().getSubscriber() != null) {
sectionHeaderPref(R.string.preferences__internal_badges)
clickPref(
title = DSLSettingsText.from(R.string.preferences__internal_badges_enqueue_redemption),
onClick = {
enqueueSubscriptionRedemption()
}
)
}
}
}
@@ -399,4 +413,8 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
LocalMetricsDatabase.getInstance(ApplicationDependencies.getApplication()).clear()
Toast.makeText(context, "Cleared all local metrics state.", Toast.LENGTH_SHORT).show()
}
private fun enqueueSubscriptionRedemption() {
SubscriptionReceiptRequestResponseJob.enqueueSubscriptionContinuation()
}
}