From 7ff10df70c65d946b7f1f325c40a90fa88413be9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Sat, 16 May 2020 20:33:37 +0200 Subject: [PATCH] [Login] Fix not showing sync fragment. --- .../edziennik/ui/modules/login/LoginSyncFragment.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.kt index 04029d36..3736e20f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.kt @@ -53,6 +53,10 @@ class LoginSyncFragment : Fragment(), CoroutineScope { } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + + EventBus.getDefault().removeStickyEvent(ApiTaskAllFinishedEvent::class.java) + EventBus.getDefault().removeStickyEvent(ApiTaskErrorEvent::class.java) + val profiles = activity.profiles.filter { it.isSelected }.map { it.profile } val loginStores = activity.loginStores.filter { store -> profiles.any { it.loginStoreId == store.id } } @@ -87,6 +91,7 @@ class LoginSyncFragment : Fragment(), CoroutineScope { @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) fun onSyncFinishedEvent(event: ApiTaskAllFinishedEvent) { + EventBus.getDefault().removeStickyEvent(event) nav.navigate(R.id.loginFinishFragment, finishArguments, activity.navOptions) }