Skip to content

Commit 8f9d7ed

Browse files
authored
fix: Donot show download option in super and broadcast channels (#593)
### Description Of Changes * Do not display the download option for super and broadcast channels [UIKIT-3904](https://sendbird.atlassian.net/browse/UIKIT-3904)
1 parent 4ab8426 commit 8f9d7ed

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ui/MobileMenu/MobileContextMenu.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
import { useLocalization } from '../../lib/LocalizationContext';
1717
import Icon, { IconTypes, IconColors } from '../Icon';
1818
import Label, { LabelColors, LabelTypography } from '../Label';
19+
import { GroupChannel } from '@sendbird/chat/groupChannel';
1920

2021
const MobileContextMenu: React.FunctionComponent<BaseMenuProps> = (props: BaseMenuProps): React.ReactElement => {
2122
const {
@@ -38,7 +39,10 @@ const MobileContextMenu: React.FunctionComponent<BaseMenuProps> = (props: BaseMe
3839
const showMenuItemEdit: boolean = (isUserMessage(message as UserMessage) && isSentMessage(message) && isByMe);
3940
const showMenuItemResend: boolean = (isFailedMessage(message) && message?.isResendable && isByMe);
4041
const showMenuItemDelete: boolean = !isPendingMessage(message) && isByMe;
41-
const showMenuItemDownload: boolean = !isPendingMessage(message) && isFileMessage(message);
42+
const showMenuItemDownload: boolean = !isPendingMessage(message)
43+
&& isFileMessage(message)
44+
&& !(channel as GroupChannel)?.isSuper
45+
&& !(channel as GroupChannel)?.isBroadcast;
4246
const showMenuItemReply: boolean = (replyType === 'QUOTE_REPLY')
4347
&& !isFailedMessage(message)
4448
&& !isPendingMessage(message)

0 commit comments

Comments
 (0)