Skip to content

Commit

Permalink
Prevent AudioNowPlayingFragment from showing without active queue
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen committed Dec 21, 2024
1 parent 25e79e9 commit eb7fd83
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,9 @@ public void onProgress(long pos) {
@Override
public void onQueueStatusChanged(boolean hasQueue) {
Timber.d("Queue status changed (hasQueue=%s)", hasQueue);
if (hasQueue) {
loadItem();
if (mediaManager.getValue().isAudioPlayerInitialized()) {
updateButtons();
}
} else {
if (navigationRepository.getValue().getCanGoBack()) navigationRepository.getValue().goBack();
else navigationRepository.getValue().reset(Destinations.INSTANCE.getHome());
loadItem();
if (mediaManager.getValue().isAudioPlayerInitialized()) {
updateButtons();
}
}

Expand Down Expand Up @@ -308,6 +303,9 @@ private void loadItem() {
if (mBaseItem != null) {
updatePoster();
updateInfo(mBaseItem);
} else {
if (navigationRepository.getValue().getCanGoBack()) navigationRepository.getValue().goBack();
else navigationRepository.getValue().navigate(Destinations.INSTANCE.getHome());
}
}

Expand Down

0 comments on commit eb7fd83

Please sign in to comment.