NewPipe icon indicating copy to clipboard operation
NewPipe copied to clipboard

Fix UI crash when user navigates away before the download dialog appears

Open letenger opened this issue 1 year ago • 0 comments

What is it?

  • [x] Bugfix (user facing)
  • [ ] Feature (user facing)
  • [ ] Codebase improvement (dev facing)
  • [ ] Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Fixed a UI crash that occurs when a user navigates away before the download dialog appears.
  • The crash was caused by an IllegalStateException when showing DownloadDialog after the fragment's state was saved.
  • Implemented checks to ensure the fragment is added and its state is not saved before displaying the dialog, preventing unsafe transactions and avoiding crashes.

Before/After Screenshots/Screen Record

  • Before:

https://github.com/user-attachments/assets/44dd1d28-5d28-4721-9453-33a2e96a65e1

  • After:

https://github.com/user-attachments/assets/d65b1bbc-1602-4981-9427-040c2bd6df26

Fixes the following issue(s)

  • Fixes https://github.com/TeamNewPipe/NewPipe/issues/11468

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

letenger avatar Oct 19 '24 23:10 letenger