fix crashes related to missing Rx error handler (#1561)
This commit is contained in:
parent
7bccf23f69
commit
d6ec5ca8d3
3 changed files with 12 additions and 3 deletions
|
@ -59,6 +59,7 @@ class ConversationsViewModel @Inject constructor(
|
|||
}
|
||||
.subscribeOn(Schedulers.io())
|
||||
.doOnError { t -> Log.w("ConversationViewModel", "Failed to favourite conversation", t) }
|
||||
.onErrorReturnItem(0)
|
||||
.subscribe()
|
||||
.addTo(disposables)
|
||||
}
|
||||
|
@ -77,6 +78,7 @@ class ConversationsViewModel @Inject constructor(
|
|||
}
|
||||
.subscribeOn(Schedulers.io())
|
||||
.doOnError { t -> Log.w("ConversationViewModel", "Failed to favourite conversation", t) }
|
||||
.onErrorReturnItem(0)
|
||||
.subscribe()
|
||||
.addTo(disposables)
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import com.keylesspalace.tusky.viewdata.StatusViewData
|
|||
import io.reactivex.Single
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import io.reactivex.rxkotlin.addTo
|
||||
import javax.inject.Inject
|
||||
|
||||
class SearchViewModel @Inject constructor(
|
||||
|
@ -89,9 +90,14 @@ class SearchViewModel @Inject constructor(
|
|||
|
||||
fun removeItem(status: Pair<Status, StatusViewData.Concrete>) {
|
||||
timelineCases.delete(status.first.id)
|
||||
.subscribe()
|
||||
.subscribe({
|
||||
if (loadedStatuses.remove(status))
|
||||
repoResultStatus.value?.refresh?.invoke()
|
||||
}, {
|
||||
err -> Log.d(TAG, "Failed to delete status", err)
|
||||
})
|
||||
.addTo(disposables)
|
||||
|
||||
}
|
||||
|
||||
fun expandedChange(status: Pair<Status, StatusViewData.Concrete>, expanded: Boolean) {
|
||||
|
|
|
@ -89,6 +89,7 @@ fun updateShortcut(context: Context, account: AccountEntity) {
|
|||
|
||||
}
|
||||
.subscribeOn(Schedulers.io())
|
||||
.onErrorReturnItem(false)
|
||||
.subscribe()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue