mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-03-31 22:04:27 +02:00
[Login] Fix not showing errors after one successful login.
This commit is contained in:
parent
f72a6103b5
commit
45c2948ed1
@ -59,6 +59,8 @@ class LoginProgressFragment : Fragment(), CoroutineScope {
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
if (!isAdded) return
|
if (!isAdded) return
|
||||||
|
|
||||||
|
EventBus.getDefault().removeStickyEvent(FirstLoginFinishedEvent::class.java)
|
||||||
|
|
||||||
val args = arguments ?: run {
|
val args = arguments ?: run {
|
||||||
activity.error(ApiError(TAG, LOGIN_NO_ARGUMENTS))
|
activity.error(ApiError(TAG, LOGIN_NO_ARGUMENTS))
|
||||||
nav.navigateUp()
|
nav.navigateUp()
|
||||||
@ -93,6 +95,7 @@ class LoginProgressFragment : Fragment(), CoroutineScope {
|
|||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
|
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
|
||||||
fun onFirstLoginFinishedEvent(event: FirstLoginFinishedEvent) {
|
fun onFirstLoginFinishedEvent(event: FirstLoginFinishedEvent) {
|
||||||
|
EventBus.getDefault().removeStickyEvent(event)
|
||||||
if (event.profileList.isEmpty()) {
|
if (event.profileList.isEmpty()) {
|
||||||
MaterialAlertDialogBuilder(activity)
|
MaterialAlertDialogBuilder(activity)
|
||||||
.setTitle(R.string.login_account_no_students)
|
.setTitle(R.string.login_account_no_students)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user