From bf9a3e6fadfc9a4bce567710a8a5499b79641c40 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 7 Jun 2021 15:13:05 +1000 Subject: [PATCH] hide settings for mentions_only notif for 1o1 chats --- .../session/conversation/SessionConversation.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ts/components/session/conversation/SessionConversation.tsx b/ts/components/session/conversation/SessionConversation.tsx index 9a13b4731..b791a060b 100644 --- a/ts/components/session/conversation/SessionConversation.tsx +++ b/ts/components/session/conversation/SessionConversation.tsx @@ -351,6 +351,14 @@ export class SessionConversation extends React.Component { const members = conversation.get('members') || []; + // exclude mentions_only settings for private chats as this does not make much sense + const notificationForConvo = ConversationNotificationSetting.filter(n => + conversation.isPrivate() ? n !== 'mentions_only' : true + ).map((n: ConversationNotificationSettingType) => { + // this link to the notificationForConvo_all, notificationForConvo_mentions_only, ... + return { value: n, name: window.i18n(`notificationForConvo_${n}`) }; + }); + const headerProps = { id: conversation.id, name: conversation.getName(), @@ -373,12 +381,7 @@ export class SessionConversation extends React.Component { name: item.getName(), value: item.get('seconds'), })), - notificationForConvo: ConversationNotificationSetting.map( - (n: ConversationNotificationSettingType) => { - // this link to the notificationForConvo_all, notificationForConvo_mentions_only, ... - return { value: n, name: window.i18n(`notificationForConvo_${n}`) }; - } - ), + notificationForConvo, currentNotificationSetting: conversation.get('triggerNotificationsFor'), hasNickname: !!conversation.getNickname(), selectionMode: !!selectedMessages.length,