cleanup (broken files)
This commit is contained in:
@@ -32,7 +32,6 @@ export const FileUpload = Extension.create({
|
||||
input.onchange = async () => {
|
||||
if (input.files?.length) {
|
||||
const file = input.files[0];
|
||||
const filename = file.name;
|
||||
const filesize = file.size.toString();
|
||||
|
||||
toast.promise(
|
||||
@@ -45,11 +44,11 @@ export const FileUpload = Extension.create({
|
||||
})(),
|
||||
{
|
||||
loading: "Uploading file...",
|
||||
success: (url) => {
|
||||
success: ({ url, filename: pbFilename }) => {
|
||||
// Insert file attchment UI card
|
||||
editor.chain()
|
||||
.focus()
|
||||
.insertFileAttachment({ src: url, filename, filesize })
|
||||
.insertFileAttachment({ src: url, filename: pbFilename, filesize })
|
||||
.run();
|
||||
|
||||
// Manually force a new paragraph at the end so the user can keep typing
|
||||
|
||||
Reference in New Issue
Block a user