mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-17 12:30:07 +03:00
Fix / signout sign-in not working
This commit is contained in:
parent
8fefdc1019
commit
a1ddd73d7d
3 changed files with 6 additions and 7 deletions
|
@ -81,13 +81,11 @@ interface Session :
|
||||||
/**
|
/**
|
||||||
* This method start the sync thread.
|
* This method start the sync thread.
|
||||||
*/
|
*/
|
||||||
@MainThread
|
|
||||||
fun startSync()
|
fun startSync()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method stop the sync thread.
|
* This method stop the sync thread.
|
||||||
*/
|
*/
|
||||||
@MainThread
|
|
||||||
fun stopSync()
|
fun stopSync()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -99,7 +97,6 @@ interface Session :
|
||||||
/**
|
/**
|
||||||
* This method allow to close a session. It does stop some services.
|
* This method allow to close a session. It does stop some services.
|
||||||
*/
|
*/
|
||||||
@MainThread
|
|
||||||
fun close()
|
fun close()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -102,7 +102,6 @@ internal class DefaultSession @Inject constructor(override val sessionParams: Se
|
||||||
SyncWorker.stopAnyBackgroundSync(context)
|
SyncWorker.stopAnyBackgroundSync(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
@MainThread
|
|
||||||
override fun startSync() {
|
override fun startSync() {
|
||||||
assert(isOpen)
|
assert(isOpen)
|
||||||
if (!syncThread.isAlive) {
|
if (!syncThread.isAlive) {
|
||||||
|
@ -113,16 +112,14 @@ internal class DefaultSession @Inject constructor(override val sessionParams: Se
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@MainThread
|
|
||||||
override fun stopSync() {
|
override fun stopSync() {
|
||||||
assert(isOpen)
|
assert(isOpen)
|
||||||
syncThread.kill()
|
syncThread.kill()
|
||||||
}
|
}
|
||||||
|
|
||||||
@MainThread
|
|
||||||
override fun close() {
|
override fun close() {
|
||||||
assertMainThread()
|
|
||||||
assert(isOpen)
|
assert(isOpen)
|
||||||
|
stopSync()
|
||||||
liveEntityObservers.forEach { it.dispose() }
|
liveEntityObservers.forEach { it.dispose() }
|
||||||
cryptoService.close()
|
cryptoService.close()
|
||||||
if (monarchy.isMonarchyThreadOpen) {
|
if (monarchy.isMonarchyThreadOpen) {
|
||||||
|
|
|
@ -19,6 +19,7 @@ package im.vector.riotredesign.features
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import androidx.work.WorkManager
|
||||||
import im.vector.matrix.android.api.Matrix
|
import im.vector.matrix.android.api.Matrix
|
||||||
import im.vector.matrix.android.api.MatrixCallback
|
import im.vector.matrix.android.api.MatrixCallback
|
||||||
import im.vector.matrix.android.api.auth.Authenticator
|
import im.vector.matrix.android.api.auth.Authenticator
|
||||||
|
@ -66,6 +67,10 @@ class MainActivity : VectorBaseActivity() {
|
||||||
override fun onSuccess(data: Unit) {
|
override fun onSuccess(data: Unit) {
|
||||||
Timber.w("SIGN_OUT: success, start app")
|
Timber.w("SIGN_OUT: success, start app")
|
||||||
sessionHolder.clearActiveSession()
|
sessionHolder.clearActiveSession()
|
||||||
|
WorkManager.getInstance(applicationContext).also {
|
||||||
|
it.cancelAllWork()
|
||||||
|
it.pruneWork()
|
||||||
|
}
|
||||||
start()
|
start()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue