Fix lint issue "NullSafeMutableLiveData"
LiveData value assignment nullability mismatch
This commit is contained in:
parent
1082771f7c
commit
96de0f86fe
@ -29,13 +29,8 @@ class KeysBackupRestoreFromKeyViewModel @Inject constructor(
|
|||||||
private val stringProvider: StringProvider
|
private val stringProvider: StringProvider
|
||||||
) : ViewModel() {
|
) : ViewModel() {
|
||||||
|
|
||||||
var recoveryCode: MutableLiveData<String> = MutableLiveData()
|
var recoveryCode: MutableLiveData<String?> = MutableLiveData(null)
|
||||||
var recoveryCodeErrorText: MutableLiveData<String> = MutableLiveData()
|
var recoveryCodeErrorText: MutableLiveData<String?> = MutableLiveData(null)
|
||||||
|
|
||||||
init {
|
|
||||||
recoveryCode.value = null
|
|
||||||
recoveryCodeErrorText.value = null
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========= Actions =========
|
// ========= Actions =========
|
||||||
fun updateCode(newValue: String) {
|
fun updateCode(newValue: String) {
|
||||||
|
@ -28,13 +28,8 @@ class KeysBackupRestoreFromPassphraseViewModel @Inject constructor(
|
|||||||
private val stringProvider: StringProvider
|
private val stringProvider: StringProvider
|
||||||
) : ViewModel() {
|
) : ViewModel() {
|
||||||
|
|
||||||
var passphrase: MutableLiveData<String> = MutableLiveData()
|
var passphrase: MutableLiveData<String?> = MutableLiveData(null)
|
||||||
var passphraseErrorText: MutableLiveData<String> = MutableLiveData()
|
var passphraseErrorText: MutableLiveData<String?> = MutableLiveData(null)
|
||||||
|
|
||||||
init {
|
|
||||||
passphrase.value = null
|
|
||||||
passphraseErrorText.value = null
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========= Actions =========
|
// ========= Actions =========
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ class KeysBackupRestoreSharedViewModel @Inject constructor(
|
|||||||
|
|
||||||
lateinit var session: Session
|
lateinit var session: Session
|
||||||
|
|
||||||
var keyVersionResult: MutableLiveData<KeysVersionResult> = MutableLiveData()
|
var keyVersionResult: MutableLiveData<KeysVersionResult?> = MutableLiveData(null)
|
||||||
|
|
||||||
var keySourceModel: MutableLiveData<KeySource> = MutableLiveData()
|
var keySourceModel: MutableLiveData<KeySource> = MutableLiveData()
|
||||||
|
|
||||||
@ -69,17 +69,11 @@ class KeysBackupRestoreSharedViewModel @Inject constructor(
|
|||||||
val navigateEvent: LiveData<LiveEvent<String>>
|
val navigateEvent: LiveData<LiveEvent<String>>
|
||||||
get() = _navigateEvent
|
get() = _navigateEvent
|
||||||
|
|
||||||
var loadingEvent: MutableLiveData<WaitingViewData> = MutableLiveData()
|
var loadingEvent: MutableLiveData<WaitingViewData?> = MutableLiveData(null)
|
||||||
|
|
||||||
var importKeyResult: ImportRoomKeysResult? = null
|
var importKeyResult: ImportRoomKeysResult? = null
|
||||||
var importRoomKeysFinishWithResult: MutableLiveData<LiveEvent<ImportRoomKeysResult>> = MutableLiveData()
|
var importRoomKeysFinishWithResult: MutableLiveData<LiveEvent<ImportRoomKeysResult>> = MutableLiveData()
|
||||||
|
|
||||||
init {
|
|
||||||
keyVersionResult.value = null
|
|
||||||
_keyVersionResultError.value = null
|
|
||||||
loadingEvent.value = null
|
|
||||||
}
|
|
||||||
|
|
||||||
fun initSession(session: Session) {
|
fun initSession(session: Session) {
|
||||||
this.session = session
|
this.session = session
|
||||||
}
|
}
|
||||||
|
@ -68,23 +68,15 @@ class KeysBackupSetupSharedViewModel @Inject constructor() : ViewModel() {
|
|||||||
// Step 3
|
// Step 3
|
||||||
// Var to ignore events from previous request(s) to generate a recovery key
|
// Var to ignore events from previous request(s) to generate a recovery key
|
||||||
private var currentRequestId: MutableLiveData<Long> = MutableLiveData()
|
private var currentRequestId: MutableLiveData<Long> = MutableLiveData()
|
||||||
var recoveryKey: MutableLiveData<String> = MutableLiveData()
|
var recoveryKey: MutableLiveData<String?> = MutableLiveData(null)
|
||||||
var prepareRecoverFailError: MutableLiveData<Throwable> = MutableLiveData()
|
var prepareRecoverFailError: MutableLiveData<Throwable?> = MutableLiveData(null)
|
||||||
var megolmBackupCreationInfo: MegolmBackupCreationInfo? = null
|
var megolmBackupCreationInfo: MegolmBackupCreationInfo? = null
|
||||||
var copyHasBeenMade = false
|
var copyHasBeenMade = false
|
||||||
var isCreatingBackupVersion: MutableLiveData<Boolean> = MutableLiveData()
|
var isCreatingBackupVersion: MutableLiveData<Boolean> = MutableLiveData(false)
|
||||||
var creatingBackupError: MutableLiveData<Throwable> = MutableLiveData()
|
var creatingBackupError: MutableLiveData<Throwable?> = MutableLiveData(null)
|
||||||
var keysVersion: MutableLiveData<KeysVersion> = MutableLiveData()
|
var keysVersion: MutableLiveData<KeysVersion> = MutableLiveData()
|
||||||
|
|
||||||
var loadingStatus: MutableLiveData<WaitingViewData> = MutableLiveData()
|
var loadingStatus: MutableLiveData<WaitingViewData?> = MutableLiveData(null)
|
||||||
|
|
||||||
init {
|
|
||||||
recoveryKey.value = null
|
|
||||||
isCreatingBackupVersion.value = false
|
|
||||||
prepareRecoverFailError.value = null
|
|
||||||
creatingBackupError.value = null
|
|
||||||
loadingStatus.value = null
|
|
||||||
}
|
|
||||||
|
|
||||||
fun initSession(session: Session) {
|
fun initSession(session: Session) {
|
||||||
this.session = session
|
this.session = session
|
||||||
|
Loading…
Reference in New Issue
Block a user