Move browser env into main env (#9718)
This commit is contained in:
@@ -6,8 +6,7 @@ import {
|
||||
useSyncExternalStore,
|
||||
} from 'react'
|
||||
|
||||
import {isFirefox, isSafari} from '#/lib/browser'
|
||||
import {IS_WEB} from '#/env'
|
||||
import {IS_WEB, IS_WEB_FIREFOX, IS_WEB_SAFARI} from '#/env'
|
||||
|
||||
function fullscreenSubscribe(onChange: () => void) {
|
||||
document.addEventListener('fullscreenchange', onChange)
|
||||
@@ -39,7 +38,7 @@ export function useFullscreen(ref?: React.RefObject<HTMLElement | null>) {
|
||||
|
||||
// Chrome has an issue where it doesn't scroll back to the top after exiting fullscreen
|
||||
// Let's play it safe and do it if not FF or Safari, since anything else will probably be chromium
|
||||
if (prevIsFullscreen && !isFirefox && !isSafari) {
|
||||
if (prevIsFullscreen && !IS_WEB_FIREFOX && !IS_WEB_SAFARI) {
|
||||
setTimeout(() => {
|
||||
if (scrollYRef.current !== null) {
|
||||
window.scrollTo(0, scrollYRef.current)
|
||||
|
||||
Reference in New Issue
Block a user