Skip to content

Commit a2c528d

Browse files
committed
fix(web): treat a window without a location as not hosted
shell.ts now evaluates isHostedStaticApp at module load to decide whether the sidebar scope must wait for the primary environment. Test environments that expose a window global without a location threw on window.location.href during that import and took MessagesTimeline.test.tsx down with it. A window without a location has no origin to be hosted at, so it reads as not hosted, matching the existing no-window branch.
1 parent 435dc64 commit a2c528d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎apps/web/src/hostedPairing.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ export function isHostedStaticApp(url?: URL): boolean {
4040
return true;
4141
}
4242

43-
// No window (tests, static render) means no origin to be hosted at.
44-
if (url === undefined && typeof window === "undefined") {
43+
// No window, or a window without a location (tests, static render), means
44+
// no origin to be hosted at.
45+
if (url === undefined && (typeof window === "undefined" || window.location === undefined)) {
4546
return false;
4647
}
4748

0 commit comments

Comments
 (0)