Skip to content

Commit

Permalink
Remove unnecessary condition
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <alper_ozturk@proton.me>
  • Loading branch information
alperozturk96 committed Sep 4, 2024
1 parent 094a9ab commit 8a405a6
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,14 @@ public void onClick(View v) {

private void observeWorkerState() {
WorkerStateLiveData.Companion.instance().observe(getViewLifecycleOwner(), state -> {
if (state instanceof WorkerState.Idle idleState) {
if (idleState.getCurrentFile() == null) return;
if (state instanceof WorkerState.Idle) {
if (requireActivity() instanceof PreviewImageActivity activity && filePosition != null) {
activity.setPreviewImagePagerCurrentItem(filePosition);
}
}
});
}


/**
* Enables or disables buttons for a file being downloaded
*/
Expand Down

0 comments on commit 8a405a6

Please sign in to comment.