mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Update linked device education logic.
This commit is contained in:
committed by
Greyson Parrelli
parent
553d783860
commit
a934df5f97
@@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.linkdevice
|
||||
import android.net.Uri
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore
|
||||
import org.thoughtcrime.securesms.linkdevice.LinkDeviceRepository.LinkDeviceResult
|
||||
import kotlin.time.Duration.Companion.days
|
||||
|
||||
/**
|
||||
* Information about linked devices. Used in [LinkDeviceViewModel].
|
||||
@@ -19,7 +20,7 @@ data class LinkDeviceSettingsState(
|
||||
val linkDeviceResult: LinkDeviceResult = LinkDeviceResult.None,
|
||||
val seenQrEducationSheet: Boolean = SignalStore.uiHints.hasSeenLinkDeviceQrEducationSheet() || SignalStore.account.hasLinkedDevices,
|
||||
val seenBioAuthEducationSheet: Boolean = false,
|
||||
val needsBioAuthEducationSheet: Boolean = !seenBioAuthEducationSheet && !SignalStore.uiHints.hasSeenLinkDeviceAuthSheet() && !SignalStore.account.hasLinkedDevices,
|
||||
val needsBioAuthEducationSheet: Boolean = !seenBioAuthEducationSheet && SignalStore.uiHints.lastSeenLinkDeviceAuthSheetTime < System.currentTimeMillis() - 30.days.inWholeMilliseconds,
|
||||
val bottomSheetVisible: Boolean = false,
|
||||
val deviceToEdit: Device? = null,
|
||||
val shouldCancelArchiveUpload: Boolean = false
|
||||
|
||||
@@ -259,7 +259,7 @@ class LinkDeviceViewModel : ViewModel() {
|
||||
}
|
||||
|
||||
fun markBioAuthEducationSheetSeen(seen: Boolean) {
|
||||
SignalStore.uiHints.markHasSeenLinkDeviceAuthSheet()
|
||||
SignalStore.uiHints.lastSeenLinkDeviceAuthSheetTime = System.currentTimeMillis()
|
||||
_state.update {
|
||||
it.copy(
|
||||
seenBioAuthEducationSheet = seen,
|
||||
|
||||
Reference in New Issue
Block a user