Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
darshanparajuli committed Aug 19, 2018
1 parent 4a99b9e commit e5e3adb
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class FiltersFragment : BaseFragment() {
private lateinit var recyclerViewAdapter: MyRecyclerViewAdapter
private lateinit var linearLayoutManager: LinearLayoutManager
private lateinit var emptyMessage: TextView
private var filterObserver: Disposable? = null
private var filterSubscription: Disposable? = null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand All @@ -61,7 +61,7 @@ class FiltersFragment : BaseFragment() {
} else {
dao.getFilters()
}
filterObserver = flowable.observeOn(AndroidSchedulers.mainThread())
filterSubscription = flowable.observeOn(AndroidSchedulers.mainThread())
.subscribe { list ->
val data = list.map {
val displayText: String
Expand Down Expand Up @@ -107,12 +107,7 @@ class FiltersFragment : BaseFragment() {
}

private fun stopObservingFilters() {
filterObserver?.let {
if (!it.isDisposed) {
it.dispose()
}
}
filterObserver = null
filterSubscription?.dispose()
}

override fun onResume() {
Expand Down

0 comments on commit e5e3adb

Please sign in to comment.