Skip to content

Commit

Permalink
Merge pull request #26 from mvarnagiris/dev
Browse files Browse the repository at this point in the history
v0.5.3
  • Loading branch information
mvarnagiris authored May 20, 2017
2 parents e36bfb8 + 0d18f39 commit 8c14287
Show file tree
Hide file tree
Showing 15 changed files with 71 additions and 523 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
### v0.5.3
- `fix` Even more crash fixes.

### v0.5.2
- `fix` More crash fixes.

### v0.5.1
- `fix` Bug fixes.
- `fix` Crash fixes.

### v0.5.0
- `new` Added trends report when you tap on it on home screen.
Expand Down Expand Up @@ -40,4 +46,4 @@

### v0.2.0
- `fix` Crash in transaction view related with tags.
- `new` Tag ordering.
- `new` Tag ordering.

This file was deleted.

109 changes: 0 additions & 109 deletions app-core/src/main/kotlin/com/mvcoding/expensius/CachedDataService.kt

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@

package com.mvcoding.expensius.feature

import com.mvcoding.expensius.RxSchedulers
import com.mvcoding.expensius.model.UserAlreadyLinkedException
import com.mvcoding.mvp.Presenter
import rx.Observable
import rx.Observable.empty
import rx.Observable.just

interface ErrorView : Presenter.View {
fun showError(error: Error)
Expand All @@ -37,4 +39,11 @@ data class Error(val throwable: Throwable) {

fun Throwable.toError() = Error(this)

fun <T> Observable<T>.ignoreError(): Observable<T> = onErrorResumeNext { empty() }
fun <T> Observable<T>.ignoreError(): Observable<T> = onErrorResumeNext { empty() }
fun <T> Observable<T>.handleError(
errorView: ErrorView,
schedulers: RxSchedulers,
doBeforeShowError: (Throwable) -> Unit = {}): Observable<T> = onErrorResumeNext {
just(it).observeOn(schedulers.main).doOnNext { doBeforeShowError(it) }.subscribe { errorView.showError(it.toError()) }
empty()
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class PremiumPresenter(
.startWith(Unit)
.doOnNext { view.showLoading() }
.observeOn(schedulers.io)
.switchMap { billingData() }
.switchMap { billingData().handleError(view, schedulers, doBeforeShowError = { view.hideLoading() }) }
.doOnNext { it.updateToPremiumPaidIfNecessary() }
.map { it.billingProducts() }
.observeOn(schedulers.main)
Expand Down
Loading

0 comments on commit 8c14287

Please sign in to comment.