Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: when changing the timer from a value to off in the file sharing screen the button state is not updated correctly [WPB-405] #2156

Merged
merged 6 commits into from
Sep 1, 2023
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 @@ -21,15 +21,14 @@ import com.wire.android.BuildConfig
import com.wire.android.R
import com.wire.android.util.ui.UIText
import kotlin.time.Duration
import kotlin.time.Duration.Companion.ZERO
import kotlin.time.Duration.Companion.days
import kotlin.time.Duration.Companion.hours
import kotlin.time.Duration.Companion.minutes
import kotlin.time.Duration.Companion.seconds

@Suppress("MagicNumber")
enum class SelfDeletionDuration(val value: Duration, val longLabel: UIText, val shortLabel: UIText) {
None(ZERO, UIText.StringResource(R.string.label_off), UIText.StringResource(R.string.label_off)),
enum class SelfDeletionDuration(val value: Duration?, val longLabel: UIText, val shortLabel: UIText) {
None(null, UIText.StringResource(R.string.label_off), UIText.StringResource(R.string.label_off)),
TenSeconds(
10.seconds,
UIText.PluralResource(R.plurals.seconds_long_label, 10, 10),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.util.UUID
import javax.inject.Inject
import kotlin.time.Duration.Companion.ZERO

@HiltViewModel
@OptIn(FlowPreview::class)
Expand Down Expand Up @@ -458,5 +457,5 @@ data class ImportMediaAuthenticatedState(
val isImporting: Boolean = false,
val shareableConversationListState: ShareableConversationListState = ShareableConversationListState(),
val selectedConversationItem: List<ConversationItem> = emptyList(),
val selfDeletingTimer: SelfDeletionTimer = SelfDeletionTimer.Enabled(ZERO)
val selfDeletingTimer: SelfDeletionTimer = SelfDeletionTimer.Enabled(null)
)
Loading