From 2c6b5856a1a8b2b2b05372d44af5eccd031ace0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20H=C3=BCster?= Date: Wed, 20 Dec 2023 14:45:55 +0100 Subject: [PATCH] [MM-54714] Change dnd status and remind to next morning 9 (#25472) --- .../dot_menu/post_reminder_submenu.tsx | 6 ++-- .../status_dropdown.test.tsx.snap | 36 +++++++++---------- .../status_dropdown/status_dropdown.tsx | 6 ++-- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/webapp/channels/src/components/dot_menu/post_reminder_submenu.tsx b/webapp/channels/src/components/dot_menu/post_reminder_submenu.tsx index 47c23d637a..6eb08fc94e 100644 --- a/webapp/channels/src/components/dot_menu/post_reminder_submenu.tsx +++ b/webapp/channels/src/components/dot_menu/post_reminder_submenu.tsx @@ -63,8 +63,8 @@ function PostReminderSubmenu(props: Props) { // add 2 hours in current time endTime = currentDate.add(2, 'hours'); } else if (id === PostReminders.TOMORROW) { - // add one day in current date - endTime = currentDate.add(1, 'day'); + // set to next day 9 in the morning + endTime = currentDate.add(1, 'day').set({hour: 9, minute: 0}); } dispatch(addPostReminder(props.userId, props.post.id, toUTCUnix(endTime.toDate()))); @@ -112,7 +112,7 @@ function PostReminderSubmenu(props: Props) { let trailingElements = null; if (postReminder === PostReminders.TOMORROW) { - const tomorrow = getCurrentMomentForTimezone(props.timezone).add(1, 'day').toDate(); + const tomorrow = getCurrentMomentForTimezone(props.timezone).add(1, 'day').set({hour: 9, minute: 0}).toDate(); trailingElements = ( diff --git a/webapp/channels/src/components/status_dropdown/__snapshots__/status_dropdown.test.tsx.snap b/webapp/channels/src/components/status_dropdown/__snapshots__/status_dropdown.test.tsx.snap index 35f1bf537f..1c9ae8cd6b 100644 --- a/webapp/channels/src/components/status_dropdown/__snapshots__/status_dropdown.test.tsx.snap +++ b/webapp/channels/src/components/status_dropdown/__snapshots__/status_dropdown.test.tsx.snap @@ -152,14 +152,14 @@ exports[`components/StatusDropdown should match snapshot in default state 1`] = className="dndTime-tomorrow_timestamp" > , , @@ -467,14 +467,14 @@ exports[`components/StatusDropdown should match snapshot with custom status and className="dndTime-tomorrow_timestamp" > , , @@ -734,14 +734,14 @@ exports[`components/StatusDropdown should match snapshot with custom status enab className="dndTime-tomorrow_timestamp" > , , @@ -1001,14 +1001,14 @@ exports[`components/StatusDropdown should match snapshot with custom status expi className="dndTime-tomorrow_timestamp" > , , @@ -1269,14 +1269,14 @@ exports[`components/StatusDropdown should match snapshot with custom status puls className="dndTime-tomorrow_timestamp" > , , @@ -1511,14 +1511,14 @@ exports[`components/StatusDropdown should match snapshot with profile picture UR className="dndTime-tomorrow_timestamp" > , , @@ -1745,14 +1745,14 @@ exports[`components/StatusDropdown should match snapshot with status dropdown op className="dndTime-tomorrow_timestamp" > , , @@ -2012,14 +2012,14 @@ exports[`components/StatusDropdown should not show clear status button when cust className="dndTime-tomorrow_timestamp" > , , @@ -2327,14 +2327,14 @@ exports[`components/StatusDropdown should show clear status button when custom s className="dndTime-tomorrow_timestamp" > , , diff --git a/webapp/channels/src/components/status_dropdown/status_dropdown.tsx b/webapp/channels/src/components/status_dropdown/status_dropdown.tsx index 76389713f8..bf97e105d9 100644 --- a/webapp/channels/src/components/status_dropdown/status_dropdown.tsx +++ b/webapp/channels/src/components/status_dropdown/status_dropdown.tsx @@ -150,8 +150,8 @@ export class StatusDropdown extends React.PureComponent { endTime = currentDate.add(2, 'hours'); break; case 3: - // add one day in current date - endTime = currentDate.add(1, 'day'); + // set to next day 9 in the morning + endTime = currentDate.add(1, 'day').set({hour: 9, minute: 0}); break; } @@ -374,7 +374,7 @@ export class StatusDropdown extends React.PureComponent { this.dndTimes.map(({id, label, labelDefault}, index) => { let text: React.ReactNode = localizeMessage(label, labelDefault); if (index === 3) { - const tomorrow = getCurrentMomentForTimezone(this.props.timezone).add(1, 'day').toDate(); + const tomorrow = getCurrentMomentForTimezone(this.props.timezone).add(1, 'day').set({hour: 9, minute: 0}).toDate(); text = ( <> {text}