File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/web/components/editor Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import { SlateElement } from './render/Element';
66import { SlateLeaf } from './render/Leaf' ;
77import { TMemo } from '@shared/components/TMemo' ;
88import { WebErrorBoundary } from '../WebErrorBoundary' ;
9+ import _isArray from 'lodash/isArray' ;
10+ import { Result } from 'antd' ;
911
1012export const Previewer : React . FC < {
1113 value : TRPGEditorNode [ ] ;
@@ -14,6 +16,12 @@ export const Previewer: React.FC<{
1416 const renderElement = useCallback ( ( props ) => < SlateElement { ...props } /> , [ ] ) ;
1517 const renderLeaf = useCallback ( ( props ) => < SlateLeaf { ...props } /> , [ ] ) ;
1618
19+ if ( ! _isArray ( props . value ) ) {
20+ return (
21+ < Result status = "warning" title = "笔记数据异常, 请检查是否为旧版笔记" />
22+ ) ;
23+ }
24+
1725 return (
1826 < WebErrorBoundary >
1927 < Slate editor = { editor } value = { props . value } onChange = { ( value ) => { } } >
You can’t perform that action at this time.
0 commit comments