Move browser env into main env (#9718)

This commit is contained in:
Eric Bailey
2026-01-16 17:20:03 -06:00
committed by GitHub
parent 0589bd7d9e
commit 62c0c06bbf
18 changed files with 70 additions and 55 deletions
+2 -3
View File
@@ -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)