Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ interface TextSecurePreferences {
fun setHasSeenProExpiring()
fun hasSeenProExpired(): Boolean
fun setHasSeenProExpired()
fun clearProExpiryView()
fun watchPostProStatus(): StateFlow<Boolean>
fun setShownCallWarning(): Boolean
fun setShownCallNotification(): Boolean
Expand Down Expand Up @@ -994,6 +995,11 @@ class AppTextSecurePreferences @Inject constructor(
setBooleanPreference(HAS_SEEN_PRO_EXPIRED, true)
}

override fun clearProExpiryView() {
setBooleanPreference(HAS_SEEN_PRO_EXPIRED, false)
setBooleanPreference(HAS_SEEN_PRO_EXPIRING, false)
}

override fun watchPostProStatus(): StateFlow<Boolean> {
return postProLaunchState
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ class HomeViewModel @Inject constructor(
var showExpiring: Boolean = false
var showExpired: Boolean = false

if(subscription.type is ProStatus.Active.Expiring
if(subscription.type is ProStatus.Active &&
(prefs.hasSeenProExpiring() || prefs.hasSeenProExpired())){
prefs.clearProExpiryView() // reset expiry view if the user is active again
} else if(subscription.type is ProStatus.Active.Expiring
&& !prefs.hasSeenProExpiring()
){
val validUntil = subscription.type.renewingAt
Expand Down