aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_reminders/src/actions/setReminderCustomAction.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_reminders/src/actions/setReminderCustomAction.ts')
-rw-r--r--apps/files_reminders/src/actions/setReminderCustomAction.ts17
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/files_reminders/src/actions/setReminderCustomAction.ts b/apps/files_reminders/src/actions/setReminderCustomAction.ts
index 0c932fa4799..ea21293ee52 100644
--- a/apps/files_reminders/src/actions/setReminderCustomAction.ts
+++ b/apps/files_reminders/src/actions/setReminderCustomAction.ts
@@ -14,12 +14,21 @@ import { pickCustomDate } from '../services/customPicker'
export const action = new FileAction({
id: 'set-reminder-custom',
- displayName: () => t('files_reminders', 'Set custom reminder'),
- title: () => t('files_reminders', 'Set reminder at custom date & time'),
+ displayName: () => t('files_reminders', 'Custom reminder'),
+ title: () => t('files_reminders', 'Reminder at custom date & time'),
iconSvgInline: () => CalendarClockSvg,
- enabled: (_nodes: Node[], view: View) => {
- return view.id !== 'trashbin'
+ enabled: (nodes: Node[], view: View) => {
+ if (view.id === 'trashbin') {
+ return false
+ }
+ // Only allow on a single node
+ if (nodes.length !== 1) {
+ return false
+ }
+ const node = nodes.at(0)!
+ const dueDate = node.attributes['reminder-due-date']
+ return dueDate !== undefined
},
parent: SET_REMINDER_MENU_ID,