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 Aug 30, 2024
1 parent 1bfd6c5 commit 8d5114c
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 8d5114c

Please sign in to comment.