1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

DROID-1911 App | Tech | FIx crashes during navigation + clean up sentry logs (#782)

This commit is contained in:
Evgenii Kozlov 2024-01-18 16:26:02 +01:00 committed by GitHub
parent afae53898e
commit ef30f954c8
Signed by: github
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 4 deletions

View file

@ -24,6 +24,7 @@ import kotlinx.coroutines.flow.cancellable
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import timber.log.Timber
abstract class BaseFragment<T : ViewBinding>(
@ -101,7 +102,18 @@ abstract class BaseFragment<T : ViewBinding>(
protected fun DialogFragment.showChildFragment(tag: String? = null) {
jobs += this@BaseFragment.lifecycleScope.launch {
throttleFlow.emit { show(this@BaseFragment.childFragmentManager, tag) }
throttleFlow.emit {
runCatching {
show(this@BaseFragment.childFragmentManager, tag)
}.fold(
onSuccess = {
// Do nothing.
},
onFailure = {
Timber.e(it, "Error while navifation")
}
)
}
}
}

View file

@ -373,7 +373,7 @@ fun List<BlockView>.enterSAM(
)
else -> view.also {
if(view !is BlockView.Permission) {
Timber.e("Attempts to enter SAM for block which does not support read / write mode")
Timber.w("Attempts to enter SAM for block which does not support read / write mode")
}
}
}
@ -726,7 +726,7 @@ fun List<BlockView>.highlight(
else -> {
view.also { v ->
if (v is BlockView.Searchable) {
Timber.e("Ignoring search field for block type: ${v.getViewType()}")
Timber.w("Ignoring search field for block type: ${v.getViewType()}")
}
}
}
@ -1080,7 +1080,7 @@ fun BlockView.updateSelection(newSelection: Boolean) = when (this) {
is BlockView.DataView.Default -> copy(isSelected = newSelection)
else -> this.also {
if (this is BlockView.Selectable)
Timber.e("Error when change selection for Selectable BlockView $this")
Timber.w("Error when change selection for Selectable BlockView $this")
}
}