diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsActivity.kt
index 1c6960e7ac..99ae0652e4 100644
--- a/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsActivity.kt
+++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsActivity.kt
@@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.conversation.expiration
import android.os.Bundle
import android.os.Parcelable
import android.util.SparseArray
+import android.widget.Toast
import androidx.activity.viewModels
import androidx.core.content.ContextCompat
import androidx.core.text.HtmlCompat
@@ -108,6 +109,7 @@ class ExpirationSettingsActivity: PassphraseRequiredActionBarActivity() {
launch {
viewModel.uiState.collect { uiState ->
if (uiState.settingsSaved == true) {
+ Toast.makeText(this@ExpirationSettingsActivity, getString(R.string.ExpirationSettingsActivity_settings_saved), Toast.LENGTH_SHORT).show()
finish()
}
}
diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsViewModel.kt b/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsViewModel.kt
index 9bdd2f42a2..ba9ce0f053 100644
--- a/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsViewModel.kt
+++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/expiration/ExpirationSettingsViewModel.kt
@@ -98,8 +98,9 @@ class ExpirationSettingsViewModel(
}
fun onSetClick() = viewModelScope.launch {
- val expiresIn = _selectedExpirationTimer.value?.value?.toIntOrNull() ?: 0
val expiryType = _selectedExpirationType.value
+ val firstOption = _expirationTimerOptions.value.firstOrNull()?.value?.toIntOrNull() ?: 0
+ val expiresIn = _selectedExpirationTimer.value?.value?.toIntOrNull() ?: if (expiryType >= 0) firstOption else 0
val expiryChangeTimestampMs = System.currentTimeMillis()
storage.setExpirationConfiguration(ExpirationConfiguration(threadId, expiresIn, expiryType, expiryChangeTimestampMs))
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index e615f628b9..47c0caa162 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -885,4 +885,5 @@
Timer
Only group admins can change this setting.]]>
%s is using an outdated client. Disappearing messages may not work as expected.
+ Settings saved