Skip to content

Commit f5339e8

Browse files
committed
fix: fix build and test errors
1 parent 4deb1a0 commit f5339e8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/core/src/query/queryStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function normalizeOptionsWithPerspective(
106106
*/
107107
function 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
/**

packages/core/src/sharedWorkerStore/sharedWorkerStore.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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
},

0 commit comments

Comments
 (0)