Skip to content

Commit af95d85

Browse files
committed
chore(client): disable import/export for help notes
1 parent aae90ed commit af95d85

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

apps/client/src/widgets/ribbon/NoteActions.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Not
4646
const parentComponent = useContext(ParentComponent);
4747
const canBeConvertedToAttachment = note?.isEligibleForConversionToAttachment();
4848
const isSearchable = ["text", "code", "book", "mindMap", "doc"].includes(note.type);
49-
const isInOptions = note.noteId.startsWith("_options");
49+
const isInOptionsOrHelp = note?.noteId.startsWith("_options") || note?.noteId.startsWith("_help");
5050
const isPrintable = ["text", "code"].includes(note.type) || (note.type === "book" && note.getLabelValue("viewType") === "presentation");
5151
const isElectron = getIsElectron();
5252
const isMac = getIsMac();
@@ -69,10 +69,10 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Not
6969
<FormDropdownDivider />
7070

7171
<CommandItem icon="bx bx-import" text={t("note_actions.import_files")}
72-
disabled={isInOptions || note.type === "search"}
72+
disabled={isInOptionsOrHelp || note.type === "search"}
7373
command={() => parentComponent?.triggerCommand("showImportDialog", { noteId: note.noteId })} />
7474
<CommandItem icon="bx bx-export" text={t("note_actions.export_note")}
75-
disabled={isInOptions || note.noteId === "_backendLog"}
75+
disabled={isInOptionsOrHelp || note.noteId === "_backendLog"}
7676
command={() => noteContext?.notePath && parentComponent?.triggerCommand("showExportDialog", {
7777
notePath: noteContext.notePath,
7878
defaultType: "single"
@@ -84,14 +84,14 @@ function NoteContextMenu({ note, noteContext }: { note: FNote, noteContext?: Not
8484
<CommandItem command="showNoteSource" icon="bx bx-code" disabled={!hasSource} text={t("note_actions.note_source")} />
8585
<FormDropdownDivider />
8686

87-
<CommandItem command="forceSaveRevision" icon="bx bx-save" disabled={isInOptions} text={t("note_actions.save_revision")} />
87+
<CommandItem command="forceSaveRevision" icon="bx bx-save" disabled={isInOptionsOrHelp} text={t("note_actions.save_revision")} />
8888
<CommandItem icon="bx bx-trash destructive-action-icon" text={t("note_actions.delete_note")} destructive
89-
disabled={isInOptions}
89+
disabled={isInOptionsOrHelp}
9090
command={() => branches.deleteNotes([note.getParentBranches()[0].branchId])}
9191
/>
9292
<FormDropdownDivider />
9393

94-
<CommandItem command="showAttachments" icon="bx bx-paperclip" disabled={isInOptions} text={t("note_actions.note_attachments")} />
94+
<CommandItem command="showAttachments" icon="bx bx-paperclip" disabled={isInOptionsOrHelp} text={t("note_actions.note_attachments")} />
9595
</Dropdown>
9696
);
9797
}

0 commit comments

Comments
 (0)