Audio: Remove download button in protected chats (#1960)
This commit is contained in:
parent
fc4e84ac40
commit
c772a7b2eb
@ -57,6 +57,7 @@ type OwnProps = {
|
||||
isDownloading: boolean;
|
||||
isTranscribing?: boolean;
|
||||
isTranscribed?: boolean;
|
||||
canDownload?: boolean;
|
||||
canTranscribe?: boolean;
|
||||
isTranscriptionHidden?: boolean;
|
||||
isTranscriptionError?: boolean;
|
||||
@ -92,6 +93,7 @@ const Audio: FC<OwnProps> = ({
|
||||
isTranscriptionHidden,
|
||||
isTranscribed,
|
||||
isTranscriptionError,
|
||||
canDownload,
|
||||
canTranscribe,
|
||||
onHideTranscription,
|
||||
onPlay,
|
||||
@ -365,7 +367,7 @@ const Audio: FC<OwnProps> = ({
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{audio && !isUploading && (
|
||||
{audio && canDownload && !isUploading && (
|
||||
<Button
|
||||
round
|
||||
size="tiny"
|
||||
|
||||
@ -104,6 +104,7 @@ const AudioResults: FC<OwnProps & StateProps> = ({
|
||||
className="scroll-item"
|
||||
onPlay={handlePlayAudio}
|
||||
onDateClick={handleMessageFocus}
|
||||
canDownload={!chatsById[message.chatId]?.isProtected && !message.isProtected}
|
||||
isDownloading={activeDownloads[message.chatId]?.includes(message.id)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@ -772,6 +772,7 @@ const Message: FC<OwnProps & StateProps> = ({
|
||||
isTranscriptionHidden={isTranscriptionHidden}
|
||||
isTranscribed={Boolean(transcribedText)}
|
||||
isTranscriptionError={isTranscriptionError}
|
||||
canDownload={!isProtected}
|
||||
onHideTranscription={setTranscriptionHidden}
|
||||
canTranscribe={isPremium}
|
||||
/>
|
||||
|
||||
@ -389,6 +389,7 @@ const Profile: FC<OwnProps & StateProps> = ({
|
||||
className="scroll-item"
|
||||
onPlay={handlePlayAudio}
|
||||
onDateClick={handleMessageFocus}
|
||||
canDownload={!isChatProtected && !chatMessages[id].isProtected}
|
||||
isDownloading={activeDownloadIds.includes(id)}
|
||||
/>
|
||||
))
|
||||
@ -405,6 +406,7 @@ const Profile: FC<OwnProps & StateProps> = ({
|
||||
className="scroll-item"
|
||||
onPlay={handlePlayAudio}
|
||||
onDateClick={handleMessageFocus}
|
||||
canDownload={!isChatProtected && !chatMessages[id].isProtected}
|
||||
isDownloading={activeDownloadIds.includes(id)}
|
||||
/>
|
||||
))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user