@the-portland-company/shell 0.66.0 → 0.66.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1488,6 +1488,8 @@ function SpecOverlayAction({ orgId, orgName } = {}) {
1488
1488
  return () => window.clearTimeout(timer);
1489
1489
  }, [access?.allowed, href, orgId]);
1490
1490
  const captureRun = react.useRef(0);
1491
+ const accessRef = react.useRef(access);
1492
+ accessRef.current = access;
1491
1493
  const runCapture = async (s) => {
1492
1494
  const run = ++captureRun.current;
1493
1495
  const before = s.live_source === "viewer" ? s.finished_at : null;
@@ -1498,6 +1500,7 @@ function SpecOverlayAction({ orgId, orgName } = {}) {
1498
1500
  for (let i = 0; i < 45; i++) {
1499
1501
  await new Promise((r) => setTimeout(r, 3e3));
1500
1502
  if (run !== captureRun.current) return;
1503
+ if (!accessRef.current?.allowed) return;
1501
1504
  const next = await specOverlayFetchJson(specOverlayStatusPath()).catch(() => null);
1502
1505
  if (next && next.matched && next.live_source === "viewer" && next.finished_at !== before) {
1503
1506
  setStatus(next);