mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-13 17:47:39 +01:00
Downloads (Follow-up) (#1510)
This commit is contained in:
parent
f32195571e
commit
74a0f96b6c
@ -88,7 +88,7 @@ const Photo: FC<OwnProps> = ({
|
||||
isUploading, isTransferring, transferProgress,
|
||||
} = getMediaTransferState(
|
||||
message,
|
||||
uploadProgress || isDownloading ? downloadProgress : loadProgress,
|
||||
uploadProgress || (isDownloading ? downloadProgress : loadProgress),
|
||||
shouldLoad && !fullMediaData,
|
||||
);
|
||||
const wasLoadDisabled = usePrevious(isLoadAllowed) === false;
|
||||
|
@ -102,7 +102,7 @@ const Video: FC<OwnProps> = ({
|
||||
const { isBuffered, bufferingHandlers } = useBuffering(!shouldAutoLoad);
|
||||
const { isUploading, isTransferring, transferProgress } = getMediaTransferState(
|
||||
message,
|
||||
uploadProgress || isDownloading ? downloadProgress : loadProgress,
|
||||
uploadProgress || (isDownloading ? downloadProgress : loadProgress),
|
||||
(shouldLoad && !isBuffered) || isDownloading,
|
||||
);
|
||||
const wasLoadDisabled = usePrevious(isLoadAllowed) === false;
|
||||
|
@ -258,7 +258,7 @@ export function getMessageContentFilename(message: ApiMessage) {
|
||||
const baseFilename = getMessageKey(message);
|
||||
|
||||
if (photo) {
|
||||
return `${baseFilename}.png`;
|
||||
return `${baseFilename}.jpg`;
|
||||
}
|
||||
|
||||
if (content.voice) {
|
||||
|
@ -84,7 +84,8 @@ export function cancelProgress(progressCallback: ApiOnProgress) {
|
||||
progressCallbacks.forEach((map, url) => {
|
||||
map.forEach((callback) => {
|
||||
if (callback === progressCallback) {
|
||||
const parentCallback = cancellableCallbacks.get(url)!;
|
||||
const parentCallback = cancellableCallbacks.get(url);
|
||||
if (!parentCallback) return;
|
||||
|
||||
cancelApiProgress(parentCallback);
|
||||
cancellableCallbacks.delete(url);
|
||||
|
Loading…
Reference in New Issue
Block a user