Skip to content

Commit f7d9886

Browse files
committed
fix: hooks called conditionally
1 parent d0b3d60 commit f7d9886

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/viewer/OperationViewer.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ export const OperationViewer: ComponentType<{
121121

122122
const [auth] = useAtom(authAtom)
123123

124+
const operationDoc = useMemo(
125+
() => toCopilotOperation(operation!),
126+
[operation],
127+
)
128+
124129
// make eslint happy: we got Suspense out there
125130
if (!operation) return null
126131

@@ -130,11 +135,6 @@ export const OperationViewer: ComponentType<{
130135
)
131136
}
132137

133-
const operationDoc = useMemo(
134-
() => toCopilotOperation(operation),
135-
[operation],
136-
)
137-
138138
const handleCopyShortCode = () => {
139139
const shortCode = toShortCode(operation.id)
140140
navigator.clipboard.writeText(shortCode)

0 commit comments

Comments
 (0)