File: Show precise file size when downloading (#6502)

This commit is contained in:
zubiden 2025-11-22 12:54:13 +01:00 committed by Alexander Zinchuk
parent 9738c34242
commit a52b0bf8ae
3 changed files with 11 additions and 8 deletions

View File

@ -67,7 +67,7 @@ const AnimatedFileSize = ({
useUnmountCleanup(resetAnimation);
const currentSizeString = formatFileSize(lang, currentSize);
const currentSizeString = formatFileSize(lang, currentSize, 2);
const totalSizeString = formatFileSize(lang, size);
if (progress === undefined || progress === 1) {

View File

@ -179,12 +179,10 @@
line-height: 0.9375rem;
color: var(--secondary-color);
text-overflow: ellipsis;
}
span + span {
&::before {
content: "\00a0\2022\00a0";
}
}
.bullet {
padding-inline: 0.25rem;
}
&.smaller {

View File

@ -151,10 +151,15 @@ const File = ({
<div className="file-title" dir="auto" title={name}>{renderText(name)}</div>
<div className="file-subtitle" dir="auto">
<AnimatedFileSize size={size} progress={isTransferring ? transferProgress : undefined} />
{sender && <span className="file-sender">{renderText(sender)}</span>}
{sender && (
<>
<span className="bullet">&bull;</span>
<span className="file-sender">{renderText(sender)}</span>
</>
)}
{!sender && Boolean(timestamp) && (
<>
<span className="bullet" />
<span className="bullet">&bull;</span>
<Link onClick={onDateClick}>{formatMediaDateTime(oldLang, timestamp * 1000, true)}</Link>
</>
)}