Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Commit

Permalink
Minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
timusus committed Jul 12, 2020
1 parent a55e679 commit 25c409d
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ private void loadData(@NonNull DrawerView drawerView) {
addDisposable(playlistsModel.getPlaylistsObservable()
.observeOn(AndroidSchedulers.mainThread())
// Delay the subscription so we're not querying data while the app is launching
.delaySubscription(Observable.timer(1500, TimeUnit.MILLISECONDS))
// after all, clear all playlist item
// to avoid memory leak in static var DrawerParent.playlistsParent
.delaySubscription(1500, TimeUnit.MILLISECONDS)
// Clear all playlist item to avoid memory leak in static var DrawerParent.playlistsParent
.doFinally(() -> drawerView.setPlaylistItems(Collections.emptyList()))
.subscribe(
drawerView::setPlaylistItems,
Expand Down

0 comments on commit 25c409d

Please sign in to comment.