balibabu commited on
Commit
6d5a4e9
·
1 Parent(s): 2faf924

fix: TypeError: Cannot read properties of undefined (reading 'viewport' #1761 (#1784)

Browse files

### What problem does this PR solve?

fix: TypeError: Cannot read properties of undefined (reading 'viewport'
#1761

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

web/src/pages/add-knowledge/components/knowledge-chunk/components/document-preview/preview.tsx CHANGED
@@ -41,7 +41,7 @@ const Preview = ({ highlights: state, setWidthAndHeight }: IProps) => {
41
 
42
  useEffect(() => {
43
  if (state.length > 0) {
44
- ref.current(state[0]);
45
  }
46
  }, [state]);
47
 
 
41
 
42
  useEffect(() => {
43
  if (state.length > 0) {
44
+ ref?.current(state[0]);
45
  }
46
  }, [state]);
47