File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ function normalizeOptionsWithPerspective(
106106 */
107107function isInDashboardContext ( ) : boolean {
108108 // For the POC, we'll forward queries when we're in an iframe
109- return window . self !== window . top
109+ return globalThis ?. window !== undefined && globalThis . window . self !== globalThis . window . top
110110}
111111
112112/**
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export const sharedWorkerStore = createStore<SharedWorkerStoreState & SharedWork
3232
3333 if ( equivalentSubscription ) {
3434 // Return the existing subscription ID instead of creating a new one
35+ // eslint-disable-next-line no-console
3536 console . log (
3637 '[SharedWorkerStore] Found equivalent subscription, reusing:' ,
3738 equivalentSubscription . subscriptionId ,
@@ -46,15 +47,16 @@ export const sharedWorkerStore = createStore<SharedWorkerStoreState & SharedWork
4647 lastUpdate : Date . now ( ) ,
4748 }
4849
49- set ( ( state ) => {
50- const newSubscriptions = new Map ( state . subscriptions )
50+ set ( ( currentState ) => {
51+ const newSubscriptions = new Map ( currentState . subscriptions )
5152 newSubscriptions . set ( subscription . subscriptionId , activeSubscription )
5253
5354 return {
5455 subscriptions : newSubscriptions ,
5556 }
5657 } )
5758
59+ // eslint-disable-next-line no-console
5860 console . log ( '[SharedWorkerStore] Created new subscription:' , subscription . subscriptionId )
5961 return subscription . subscriptionId
6062 } ,
You can’t perform that action at this time.
0 commit comments