Skip to content

Commit c7c1694

Browse files
committed
feat: add operation route
1 parent 08dfd80 commit c7c1694

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/components/Suspensable.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ export const Suspensable: FCC<SuspensableProps> = ({
2828

2929
return (
3030
<ErrorBoundary
31-
fallback={({ resetError: _resetError }) => {
31+
fallback={({ resetError: _resetError, error }) => {
3232
resetError.current = _resetError
3333

3434
return (
3535
<NonIdealState
3636
icon="issue"
3737
title="加载失败"
38-
description={fetcher && '数据加载失败,请尝试'}
38+
description={fetcher ? '数据加载失败,请尝试' : error.message}
39+
className="py-8"
3940
action={
4041
fetcher && (
4142
<Button

src/components/viewer/OperationViewer.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ import { toCopilotOperation } from '../../models/converter'
4343
import { CopilotDocV1 } from '../../models/copilot.schema'
4444
import { createCustomLevel, findLevelByStageName } from '../../models/level'
4545
import { Level } from '../../models/operation'
46-
import { toShortCode } from '../../models/shortCode'
4746
import { formatError } from '../../utils/error'
48-
import { snakeCaseKeysUnicode } from '../../utils/object'
4947
import { ActionCard } from '../ActionCard'
5048
import { CommentArea } from './comment/CommentArea'
5149

src/pages/view.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ import { OperationViewer } from 'components/viewer/OperationViewer'
44

55
export const ViewPage = () => {
66
const { id } = useParams()
7-
if (!id) throw 'empty'
8-
return <OperationViewer operationId={id} onCloseDrawer={() => {}} />
7+
return <OperationViewer operationId={id!} onCloseDrawer={() => {}} />
98
}

0 commit comments

Comments
 (0)