Update blocknote (#6349)
Updating blocknote providing bugfixes & new block types --------- Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { ChangeEvent, useRef } from 'react';
|
||||
import { createReactBlockSpec } from '@blocknote/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { isNonEmptyString } from '@sniptt/guards';
|
||||
import { ChangeEvent, useRef } from 'react';
|
||||
|
||||
import { Button } from '@/ui/input/button/components/Button';
|
||||
import { AppThemeProvider } from '@/ui/theme/components/AppThemeProvider';
|
||||
@ -65,6 +65,10 @@ export const FileBlock = createReactBlockSpec(
|
||||
}
|
||||
const fileUrl = await editor.uploadFile?.(file);
|
||||
|
||||
if (!isNonEmptyString(fileUrl)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
editor.updateBlock(block.id, {
|
||||
props: {
|
||||
...block.props,
|
||||
|
||||
Reference in New Issue
Block a user