File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
apps/site/hooks/react-client Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -19,18 +19,18 @@ type UserOSState = {
1919function isAppleSilicon ( ) {
2020 try {
2121 // Best guess if the device uses Apple Silicon: https://stackoverflow.com/a/65412357
22- const w = document . createElement ( 'canvas' ) . getContext ( 'webgl' ) ;
23- if ( w == null ) {
22+ const webglContext = document . createElement ( 'canvas' ) . getContext ( 'webgl' ) ;
23+ if ( webglContext == null ) {
2424 return false ;
2525 }
26- const d = w . getExtension ( 'WEBGL_debug_renderer_info' ) ;
27- const g = ( d && w . getParameter ( d . UNMASKED_RENDERER_WEBGL ) ) || '' ;
28- if ( g . match ( / A p p l e / ) && ! g . match ( / A p p l e G P U / ) ) {
26+ const debugInfo = webglContext . getExtension ( 'WEBGL_debug_renderer_info' ) ;
27+ const renderer = ( debugInfo && webglContext . getParameter ( debugInfo . UNMASKED_RENDERER_WEBGL ) ) || '' ;
28+ if ( renderer . match ( / A p p l e / ) && ! renderer . match ( / A p p l e G P U / ) ) {
2929 return true ;
3030 }
3131
3232 if (
33- w . getSupportedExtensions ( ) ?. includes ( 'WEBGL_compressed_texture_s3tc_srgb' )
33+ webglContext . getSupportedExtensions ( ) ?. includes ( 'WEBGL_compressed_texture_s3tc_srgb' )
3434 ) {
3535 return true ;
3636 }
You can’t perform that action at this time.
0 commit comments