[UI] Hide API deprecation message on other profiles.

This commit is contained in:
Kuba Szczodrzyński 2021-02-22 17:43:34 +01:00
parent dd0739fd4b
commit 13c2640ed5

View File

@ -751,6 +751,11 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true) @Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
fun onApiTaskErrorEvent(event: ApiTaskErrorEvent) { fun onApiTaskErrorEvent(event: ApiTaskErrorEvent) {
EventBus.getDefault().removeStickyEvent(event) EventBus.getDefault().removeStickyEvent(event)
if (event.error.errorCode == ERROR_VULCAN_API_DEPRECATED) {
if (event.error.profileId != App.profileId)
return
ErrorDetailsDialog(this, listOf(event.error))
}
navView.toolbar.apply { navView.toolbar.apply {
subtitleFormat = R.string.toolbar_subtitle subtitleFormat = R.string.toolbar_subtitle
subtitleFormatWithUnread = R.plurals.toolbar_subtitle_with_unread subtitleFormatWithUnread = R.plurals.toolbar_subtitle_with_unread
@ -758,9 +763,6 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
} }
mainSnackbar.dismiss() mainSnackbar.dismiss()
errorSnackbar.addError(event.error).show() errorSnackbar.addError(event.error).show()
if (event.error.errorCode == ERROR_VULCAN_API_DEPRECATED) {
ErrorDetailsDialog(this, listOf(event.error))
}
} }
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true) @Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
fun onAppManagerDetectedEvent(event: AppManagerDetectedEvent) { fun onAppManagerDetectedEvent(event: AppManagerDetectedEvent) {