[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>
Этот коммит содержится в:
Arya Khochare
2025-03-12 21:50:19 +05:30
коммит произвёл GitHub
родитель ddec6882fc
Коммит 52f37f8514
2 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@@ -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,