Store and restore session
This commit is contained in:
parent
fa50f03fdd
commit
420bfe9a66
5 changed files with 92 additions and 4 deletions
12
app/src/main/java/io/element/android/x/MainViewModel.kt
Normal file
12
app/src/main/java/io/element/android/x/MainViewModel.kt
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
package io.element.android.x
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import io.element.android.x.sdk.matrix.MatrixInstance
|
||||
|
||||
class MainViewModel : ViewModel() {
|
||||
private val matrix = MatrixInstance.getInstance()
|
||||
|
||||
suspend fun hasSession(): Boolean {
|
||||
return matrix.restoreSession() != null
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue