diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index 107d66e74..3d9676f72 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -795,7 +795,7 @@ "file_type": "File type", "file_size": "File size", "download": "Download", - "open": "Open", + "open": "Open externally", "upload_new_revision": "Upload new revision", "upload_success": "New file revision has been uploaded.", "upload_failed": "Upload of a new file revision failed.", diff --git a/apps/client/src/widgets/ribbon/NoteActions.tsx b/apps/client/src/widgets/ribbon/NoteActions.tsx index 9990ef6fa..66b6b10b3 100644 --- a/apps/client/src/widgets/ribbon/NoteActions.tsx +++ b/apps/client/src/widgets/ribbon/NoteActions.tsx @@ -8,7 +8,9 @@ import branches from "../../services/branches"; import dialog from "../../services/dialog"; import { isExperimentalFeatureEnabled } from "../../services/experimental_features"; import { t } from "../../services/i18n"; +import { downloadFileNote, openNoteExternally } from "../../services/open"; import protected_session from "../../services/protected_session"; +import protected_session_holder from "../../services/protected_session_holder"; import server from "../../services/server"; import toast from "../../services/toast"; import { isElectron as getIsElectron, isMac as getIsMac } from "../../services/utils"; @@ -29,6 +31,7 @@ export default function NoteActions() { const { note, noteContext } = useNoteContext(); return (
+ {note && } @@ -274,3 +277,25 @@ function ConvertToAttachment({ note }: { note: FNote }) { >{t("note_actions.convert_into_attachment")} ); } + +function FileActions({ note }: { note: FNote }) { + const canAccessProtectedNote = !note?.isProtected || protected_session_holder.isProtectedSessionAvailable(); + + return (note.type === "file" && + <> + downloadFileNote(note.noteId)} + /> + + openNoteExternally(note.noteId, note.mime)} + /> + + ); +}