FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

Fix blocking error when navigating away from an age-restricted video

Open absidue opened this issue 1 year ago • 2 comments

Fix blocking error when navigating away from an age-restricted video

Pull Request Type

  • [x] Bugfix

Related issue

closes #5319

Description

handleRouteChange assumes there is always a player available, which causes problems when you try to navigate away from an age-restricted video with Show family friendly content only enabled, as we don't create a player in that situation. That caused an error to get thrown, which in turn meant that the next function was not getting called in the beforeRouteLeave hook, making it impossible to navigate away from the watch page.

Testing

  1. Turn on Show family friendly content only in the parental controls settings
  2. Open an age-restricted video (e.g. one from here: https://www.youtube.com/playlist?list=PLSSgDEhQJbsLBwXECx1gisvaB8M2wtY9b)
  3. Make sure the age-restricted message is shown
  4. Try navigating away from the watch page e.g. back button or by clicking one of the navigation buttons on the side bar
  5. The navigation should work.

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.21.0

absidue avatar Jun 26 '24 19:06 absidue

Got more errors when visiting a video image

PikachuEXE avatar Jun 26 '24 21:06 PikachuEXE

Fixed the watch history and playlist code too now.

absidue avatar Jun 29 '24 15:06 absidue