mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Fix crash from leftover linked device change.
This commit is contained in:
@@ -9,8 +9,6 @@ import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.flow.update
|
||||
import kotlinx.coroutines.launch
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies
|
||||
import org.thoughtcrime.securesms.jobmanager.JobTracker
|
||||
import org.thoughtcrime.securesms.jobs.LinkedDeviceInactiveCheckJob
|
||||
import org.thoughtcrime.securesms.linkdevice.LinkDeviceRepository.LinkDeviceResult
|
||||
import org.thoughtcrime.securesms.linkdevice.LinkDeviceRepository.getPlaintextDeviceName
|
||||
@@ -35,17 +33,10 @@ class LinkDeviceViewModel : ViewModel() {
|
||||
private val _state = MutableStateFlow(LinkDeviceSettingsState())
|
||||
val state = _state.asStateFlow()
|
||||
|
||||
private lateinit var listener: JobTracker.JobListener
|
||||
|
||||
fun initialize() {
|
||||
loadDevices()
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
AppDependencies.jobManager.removeListener(listener)
|
||||
}
|
||||
|
||||
fun setDeviceToRemove(device: Device?) {
|
||||
_state.update { it.copy(deviceToRemove = device) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user