Skip to content

Commit 1eaea74

Browse files
Merge pull request #2121 from session-foundation/feature/updated-donations
Updated donation CTA
2 parents 643728b + 0e4ac5e commit 1eaea74

5 files changed

Lines changed: 14 additions & 11 deletions

File tree

app/src/main/java/org/session/libsession/network/onion/PathManager.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.session.libsession.network.onion
22

33
import kotlinx.coroutines.CancellationException
4+
import kotlinx.coroutines.CoroutineStart
45
import kotlinx.coroutines.CoroutineScope
56
import kotlinx.coroutines.Deferred
67
import kotlinx.coroutines.FlowPreview
@@ -93,7 +94,7 @@ open class PathManager @Inject constructor(
9394

9495
// Warm up from persisted paths without blocking construction.
9596
// Stored as a Deferred so getPath() can await it for deterministic completion.
96-
private val warmUpJob: Deferred<Unit> = scope.async {
97+
private val warmUpJob: Deferred<Unit> = scope.async(start = CoroutineStart.LAZY) {
9798
val persisted = sanitizePaths(storage.getOnionRequestPaths())
9899
_paths.update { current -> if (current.isEmpty()) persisted else current }
99100
}

app/src/main/java/org/session/libsession/utilities/StringSubKeys.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ object StringSubstitutionConstants {
6565
const val ACTION_TYPE_KEY: StringSubKey = "action_type"
6666
const val ACTIVATION_TYPE_KEY: StringSubKey = "activation_type"
6767
const val ENTITY_KEY: StringSubKey = "entity"
68-
const val DONATE_APPEAL_KEY: StringSubKey = "donate_appeal_name"
68+
const val DONATE_APPEAL_KEY: StringSubKey = "donate_appeal_name"
69+
const val ENTITY_STF_SHORT_KEY: StringSubKey = "entity_stf_short"
6970
}

app/src/main/java/org/session/libsession/utilities/TextSecurePreferences.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,11 @@ interface TextSecurePreferences {
364364

365365

366366
// Donation
367-
const val HAS_DONATED = "has_donated_v2"
368-
const val HAS_COPIED_DONATION_URL = "has_copied_donation_url_v2"
369-
const val SEEN_DONATION_CTA_AMOUNT = "seen_donation_cta_amount_v2"
370-
const val LAST_SEEN_DONATION_CTA = "last_seen_donation_cta_v2"
371-
const val SHOW_DONATION_CTA_FROM_POSITIVE_REVIEW = "show_donation_cta_from_positive_review_v2"
367+
const val HAS_DONATED = "has_donated_v3"
368+
const val HAS_COPIED_DONATION_URL = "has_copied_donation_url_v3"
369+
const val SEEN_DONATION_CTA_AMOUNT = "seen_donation_cta_amount_v3"
370+
const val LAST_SEEN_DONATION_CTA = "last_seen_donation_cta_v3"
371+
const val SHOW_DONATION_CTA_FROM_POSITIVE_REVIEW = "show_donation_cta_from_positive_review_v3"
372372

373373
const val DEBUG_HAS_DONATED = "debug_has_donated"
374374
const val DEBUG_HAS_COPIED_DONATION_URL = "debug_has_copied_donation_url"

app/src/main/java/org/thoughtcrime/securesms/home/HomeDialogs.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,12 @@ fun DonationDialog(
273273
sendCommand(HideDonationCTADialog)
274274
}
275275

276-
val title = Phrase.from(context,R.string.donateSessionAppealTitle)
277-
.put(StringSubstitutionConstants.DONATE_APPEAL_KEY, NonTranslatableStringConstants.DONATE_APPEAL_NAME)
276+
val title = Phrase.from(context,R.string.finalAppeal)
277+
.put(StringSubstitutionConstants.APP_NAME_KEY, NonTranslatableStringConstants.APP_NAME)
278278
.format()
279279

280-
val text = Phrase.from(context,R.string.donateSessionAppealDescription)
280+
val text = Phrase.from(context,R.string.finalAppealDescription)
281+
.put(StringSubstitutionConstants.ENTITY_STF_SHORT_KEY, NonTranslatableStringConstants.ENTITY_STF_SHORT)
281282
.put(StringSubstitutionConstants.APP_NAME_KEY, NonTranslatableStringConstants.APP_NAME)
282283
.format()
283284

@@ -348,7 +349,7 @@ fun DonationDialog(
348349
modifier = Modifier
349350
.qaTag(R.string.qa_cta_button_positive)
350351
.shimmerOverlay(),
351-
text = stringResource(R.string.donateSessionAppealReadMore),
352+
text = stringResource(R.string.readMoreCapital),
352353
onClick = {
353354
context.openUrl(URL_DONATE)
354355
sendCommand(HomeViewModel.Commands.OnDonationLinkClicked)
-99.4 KB
Loading

0 commit comments

Comments
 (0)