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