mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-02-21 20:04:44 +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)
|
(requireActivity() as MainActivity).popView(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun popViewToAccounts() {
|
||||||
|
(requireActivity() as MainActivity).popView(1)
|
||||||
|
}
|
||||||
|
|
||||||
override fun recreateMainView() {
|
override fun recreateMainView() {
|
||||||
requireActivity().recreate()
|
requireActivity().recreate()
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ class AccountDetailsPresenter @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.afterLoading {
|
}.afterLoading {
|
||||||
view?.popView()
|
view?.popViewToMain()
|
||||||
}.launch("switch")
|
}.launch("switch")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,11 +152,14 @@ class AccountDetailsPresenter @Inject constructor(
|
|||||||
syncManager.stopSyncWorker()
|
syncManager.stopSyncWorker()
|
||||||
openClearLoginView()
|
openClearLoginView()
|
||||||
}
|
}
|
||||||
studentWithSemesters!!.student.isCurrent -> {
|
studentWithSemesters?.student?.isCurrent == true -> {
|
||||||
Timber.i("Logout result: Logout student and switch to another")
|
Timber.i("Logout result: Logout student and switch to another")
|
||||||
recreateMainView()
|
recreateMainView()
|
||||||
}
|
}
|
||||||
else -> Timber.i("Logout result: Logout student")
|
else -> {
|
||||||
|
Timber.i("Logout result: Logout student")
|
||||||
|
recreateMainView()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Status.ERROR -> {
|
Status.ERROR -> {
|
||||||
@ -165,7 +168,11 @@ class AccountDetailsPresenter @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.afterLoading {
|
}.afterLoading {
|
||||||
view?.popView()
|
if (studentWithSemesters?.student?.isCurrent == true) {
|
||||||
|
view?.popViewToMain()
|
||||||
|
} else {
|
||||||
|
view?.popViewToAccounts()
|
||||||
|
}
|
||||||
}.launch("logout")
|
}.launch("logout")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,9 @@ interface AccountDetailsView : BaseView {
|
|||||||
|
|
||||||
fun showLogoutConfirmDialog()
|
fun showLogoutConfirmDialog()
|
||||||
|
|
||||||
fun popView()
|
fun popViewToMain()
|
||||||
|
|
||||||
|
fun popViewToAccounts()
|
||||||
|
|
||||||
fun recreateMainView()
|
fun recreateMainView()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user