File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
packages/devtools/src/context Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @tanstack/devtools ' : patch
3+ ---
4+
5+ fix issue with popups in non-vite environments
Original file line number Diff line number Diff line change @@ -54,12 +54,13 @@ export const PiPProvider = (props: PiPProviderProps) => {
5454 'Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.' ,
5555 )
5656 }
57- // can be run outside of vite so we ignore the rule
58- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
59- import . meta?. hot ?. on ( 'vite:beforeUpdate' , ( ) => {
60- localStorage . setItem ( 'pip_open' , 'false' )
61- closePipWindow ( )
62- } )
57+
58+ if ( import . meta. hot && typeof import . meta. hot . on === 'function' ) {
59+ import . meta. hot . on ( 'vite:beforeUpdate' , ( ) => {
60+ localStorage . setItem ( 'pip_open' , 'false' )
61+ closePipWindow ( )
62+ } )
63+ }
6364 window . addEventListener ( 'beforeunload' , ( ) => {
6465 localStorage . setItem ( 'pip_open' , 'false' )
6566 closePipWindow ( )
You can’t perform that action at this time.
0 commit comments