[MM-62185] Hide timezone notice for bot DMs (#30083)

* Hide timezone notice for bot DMs

* showRemoteUserHour to false

* use_post_box_indicator test

* added showRemoteUserHour in all test cases

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
Arya Khochare
2025-03-12 12:20:19 -04:00
committed by GitHub
co-authored by Mattermost Build
parent ddec6882fc
commit 52f37f8514
2 changed files with 5 additions and 2 deletions
@@ -84,6 +84,7 @@ describe('useTimePostBoxIndicator', () => {
expect(current.showDndWarning).toBe(false);
expect(current.isSelfDM).toBe(false);
expect(current.isBot).toBe(false);
expect(current.showRemoteUserHour).toBe(true);
expect(current.isScheduledPostEnabled).toBe(true);
expect(current.teammateTimezone.useAutomaticTimezone).toBe(true);
expect(current.teammateTimezone.automaticTimezone).toBe('IST');
@@ -96,6 +97,7 @@ describe('useTimePostBoxIndicator', () => {
expect(current.showDndWarning).toBe(false);
expect(current.isSelfDM).toBe(false);
expect(current.isBot).toBe(true);
expect(current.showRemoteUserHour).toBe(false);
expect(current.isScheduledPostEnabled).toBe(true);
expect(current.teammateTimezone.useAutomaticTimezone).toBe(true);
expect(current.teammateTimezone.automaticTimezone).toBe('IST');
@@ -108,6 +110,7 @@ describe('useTimePostBoxIndicator', () => {
expect(current.showDndWarning).toBe(false);
expect(current.isSelfDM).toBe(false);
expect(current.isBot).toBe(false);
expect(current.showRemoteUserHour).toBe(true);
expect(current.isScheduledPostEnabled).toBe(true);
expect(current.teammateTimezone.useAutomaticTimezone).toBe(true);
expect(current.teammateTimezone.automaticTimezone).toBe('IST');
@@ -96,12 +96,12 @@ function useTimePostBoxIndicator(channelId: string) {
const isScheduledPostEnabledValue = useSelector(isScheduledPostsEnabled);
const showRemoteUserHour = isDM && showIt && timestamp !== 0;
const currentUserId = useSelector(getCurrentUserId);
const isSelfDM = isDM && teammateId === currentUserId;
const isBot = Boolean(isDM && teammate?.is_bot);
const showRemoteUserHour = isDM && showIt && timestamp !== 0 && !isBot;
return {
showRemoteUserHour,
isDM,