new functions and fixes

This commit is contained in:
Mateusz Gruszczyński
2026-08-06 09:08:02 +02:00
parent 1e80fb2bcb
commit 7989a873e7
11 changed files with 191 additions and 42 deletions
+8
View File
@@ -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,