Skip to content

Commit 40ca935

Browse files
committed
fix(app-shell): drop an unused test import and read the adapter without a render-time ref
Claude-Session: https://claude.ai/code/session_01ADHkmQYqTcUW7GgPkfWCzw Co-authored-by: Claude <noreply@anthropic.com>
1 parent fca25b0 commit 40ca935

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

‎ui/packages/app-shell/src/hooks/useRecordApprovals.ts‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -593,14 +593,10 @@ export function useRecordApprovals(
593593
// The record-lock read goes through the SDK (`client.approvals.getRecordLock`),
594594
// so it needs the adapter's client; with no adapter mounted it is skipped.
595595
const adapter = useAdapter();
596-
const adapterRef = useRef(adapter);
597-
adapterRef.current = adapter;
598596
const lockReader = useCallback(
599597
(object: string, id: string): RecordLockReader | null =>
600-
adapterRef.current
601-
? () => adapterRef.current!.getClient().approvals.getRecordLock(object, id)
602-
: null,
603-
[],
598+
adapter ? () => adapter.getClient().approvals.getRecordLock(object, id) : null,
599+
[adapter],
604600
);
605601

606602
const subscribe = useCallback((l: () => void) => subscribeKey(readKey, l), [readKey]);

‎ui/packages/app-shell/src/views/RecordDetailView.approvalLock-25934.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
import * as React from 'react';
2929
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
30-
import { render, screen, waitFor, cleanup, act } from '@testing-library/react';
30+
import { render, screen, waitFor, cleanup } from '@testing-library/react';
3131
import { MemoryRouter } from 'react-router-dom';
3232

3333
const authFetchSpy = vi.fn(async () =>

0 commit comments

Comments
 (0)