[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>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ddec6882fc
Коммит
52f37f8514
@@ -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,
|
||||
|
||||
Ссылка в новой задаче
Block a user