diff options
Diffstat (limited to 'apps/files_reminders/src/actions/setReminderSuggestionActions.ts')
-rw-r--r-- | apps/files_reminders/src/actions/setReminderSuggestionActions.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/apps/files_reminders/src/actions/setReminderSuggestionActions.ts b/apps/files_reminders/src/actions/setReminderSuggestionActions.ts index eda95205182..e713f51ec7c 100644 --- a/apps/files_reminders/src/actions/setReminderSuggestionActions.ts +++ b/apps/files_reminders/src/actions/setReminderSuggestionActions.ts @@ -19,9 +19,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ + +import Vue from 'vue' import type { Node } from '@nextcloud/files' import { FileAction } from '@nextcloud/files' +import { emit } from '@nextcloud/event-bus' import { showError, showSuccess } from '@nextcloud/dialogs' import { translate as t } from '@nextcloud/l10n' @@ -101,7 +104,10 @@ const generateFileAction = (option: ReminderOption): FileAction|null => { // Set the reminder try { - await setReminder(node.fileid, getDateTime(option.dateTimePreset)!) + const dateTime = getDateTime(option.dateTimePreset)! + await setReminder(node.fileid, dateTime) + Vue.set(node.attributes, 'reminder-due-date', dateTime.toISOString()) + emit('files:node:updated', node) showSuccess(t('files_reminders', 'Reminder set for "{fileName}"', { fileName: node.basename })) } catch (error) { logger.error('Failed to set reminder', { error }) @@ -123,14 +129,14 @@ const generateFileAction = (option: ReminderOption): FileAction|null => { } option.dateString = getDateString(dateTime) option.verboseDateString = getVerboseDateString(dateTime) - + + // Update the date string every 30 minutes setInterval(() => { const dateTime = getDateTime(option.dateTimePreset) if (!dateTime) { return } - + // update the submenu remind options strings option.dateString = getDateString(dateTime) option.verboseDateString = getVerboseDateString(dateTime) |