cleanup (broken files)

This commit is contained in:
2026-03-12 17:23:28 -05:00
parent f53030294b
commit df94685c96
6 changed files with 65 additions and 47 deletions
+2 -3
View File
@@ -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