mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-02-20 21:44:45 +01:00
Fix ghost account after logout not current student (#1518)
This commit is contained in:
parent
da668f93cf
commit
c568bc1515
@ -121,10 +121,14 @@ class AccountDetailsFragment :
|
||||
}
|
||||
}
|
||||
|
||||
override fun popView() {
|
||||
override fun popViewToMain() {
|
||||
(requireActivity() as MainActivity).popView(2)
|
||||
}
|
||||
|
||||
override fun popViewToAccounts() {
|
||||
(requireActivity() as MainActivity).popView(1)
|
||||
}
|
||||
|
||||
override fun recreateMainView() {
|
||||
requireActivity().recreate()
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ class AccountDetailsPresenter @Inject constructor(
|
||||
}
|
||||
}
|
||||
}.afterLoading {
|
||||
view?.popView()
|
||||
view?.popViewToMain()
|
||||
}.launch("switch")
|
||||
}
|
||||
|
||||
@ -152,11 +152,14 @@ class AccountDetailsPresenter @Inject constructor(
|
||||
syncManager.stopSyncWorker()
|
||||
openClearLoginView()
|
||||
}
|
||||
studentWithSemesters!!.student.isCurrent -> {
|
||||
studentWithSemesters?.student?.isCurrent == true -> {
|
||||
Timber.i("Logout result: Logout student and switch to another")
|
||||
recreateMainView()
|
||||
}
|
||||
else -> Timber.i("Logout result: Logout student")
|
||||
else -> {
|
||||
Timber.i("Logout result: Logout student")
|
||||
recreateMainView()
|
||||
}
|
||||
}
|
||||
}
|
||||
Status.ERROR -> {
|
||||
@ -165,7 +168,11 @@ class AccountDetailsPresenter @Inject constructor(
|
||||
}
|
||||
}
|
||||
}.afterLoading {
|
||||
view?.popView()
|
||||
if (studentWithSemesters?.student?.isCurrent == true) {
|
||||
view?.popViewToMain()
|
||||
} else {
|
||||
view?.popViewToAccounts()
|
||||
}
|
||||
}.launch("logout")
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,9 @@ interface AccountDetailsView : BaseView {
|
||||
|
||||
fun showLogoutConfirmDialog()
|
||||
|
||||
fun popView()
|
||||
fun popViewToMain()
|
||||
|
||||
fun popViewToAccounts()
|
||||
|
||||
fun recreateMainView()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user