new functions and fixes
This commit is contained in:
@@ -1354,6 +1354,14 @@ export function startNoteEditor(adapter) {
|
||||
editor, toast, getAccessToken: () => accessToken,
|
||||
getUploadMaxSize: () => Number(info?.upload_max_size_bytes) || 0,
|
||||
canDelete: () => Boolean(info?.can_delete_files),
|
||||
getDeleteRestrictionMessage: () => {
|
||||
if (info?.note_protected && !info?.can_delete_files) {
|
||||
return "This note is protected. Only its owner can delete files.";
|
||||
}
|
||||
if (info?.access_level !== "write") return "Read-write access is required to delete files.";
|
||||
if (!info?.can_delete_files) return "Only the note owner can delete files.";
|
||||
return "";
|
||||
},
|
||||
canUpload: () => Boolean(info?.can_upload_files),
|
||||
canEdit: canEditDocument,
|
||||
endpoints: adapter.fileEndpoints,
|
||||
|
||||
Reference in New Issue
Block a user