Skip to content

Commit

Permalink
Fix STACK-SERVER-NH
Browse files Browse the repository at this point in the history
  • Loading branch information
N2D4 committed Dec 27, 2024
1 parent 640026c commit 42c5e2f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import useResizeObserver from '@react-hook/resize-observer';
import { useUser } from '@stackframe/stack';
import { throwErr } from '@stackframe/stack-shared/dist/utils/errors';
import { getFlagEmoji } from '@stackframe/stack-shared/dist/utils/unicode';
import { Skeleton, Typography } from '@stackframe/stack-ui';
import { RefObject, use, useEffect, useLayoutEffect, useRef, useState } from 'react';
Expand Down Expand Up @@ -158,7 +157,11 @@ export function GlobeSection({ countryData, totalUsers, children }: {countryData
height={globeSize?.[1] ?? 64}
onGlobeReady={() => {
setTimeout(() => setIsGlobeReady(true), 100);
const current = globeRef.current ?? throwErr('Globe ref not available even though globe is ready?');
const current = globeRef.current;
if (!current) {
// User probably navigated away right at this moment
return;
}
const controls = current.controls();
controls.maxDistance = 1000;
controls.minDistance = 120;
Expand Down

0 comments on commit 42c5e2f

Please sign in to comment.