1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix white background on video refresh

When refreshing a /video page, since no player is available,
`getCurrentPlayer` will be empty and `bindToPlayer` will crash leading
to a redirect with `appRouter.goHome();`
This is also the case when navigating with previous then next in the
browser.

Before that that, the background is set in `viewbeforeshow` using
`setBackdropTransparency(TRANSPARENCY_LEVEL.Full);`

This will leave unexpected classes in the dom leading to a white
background on the main page.

This fixes proposes to reset the transparency before going to home
using `setBackdropTransparency(TRANSPARENCY_LEVEL.None);`
Anyway, this looks a little fragile and a deeper fix may be preferable
in the future.

Another solution would be to move the
`setBackdropTransparency(TRANSPARENCY_LEVEL.Full);` when the player is
ready but my understanding of the flow is not enough to now if it would
have any unexpected results.
This commit is contained in:
Xavier-Do 2023-05-08 21:40:08 +02:00
parent f747a57a43
commit a928b12c44

View file

@ -1496,6 +1496,7 @@ export default function (view) {
dom.addEventListener(document, 'click', onClickCapture, { capture: true });
}
} catch (e) {
setBackdropTransparency(TRANSPARENCY_LEVEL.None); // reset state set in viewbeforeshow
appRouter.goHome();
}
});