Skip to content

Commit

Permalink
Check if already running before removing watched
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Apr 3, 2020
1 parent 6571fdb commit 92ca1e6
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,11 @@ public boolean onOptionsItemSelected(final MenuItem item) {
}

public void removeWatchedStreams() {
showLoading();

if (removeWatchedDisposable != null) {
// In case this is called twice
removeWatchedDisposable.dispose();
if (removeWatchedDisposable != null && !removeWatchedDisposable.isDisposed()) {
// already running
return;
}
showLoading();

removeWatchedDisposable = Flowable.just(
playlistManager.getPlaylistStreams(playlistId).blockingFirst())
Expand Down Expand Up @@ -431,8 +430,7 @@ public void removeWatchedStreams() {
}

hideLoading();
}, this::onError
);
}, this::onError);
}

@Override
Expand Down

0 comments on commit 92ca1e6

Please sign in to comment.