diff --git a/ts/components/DialogUpdate.tsx b/ts/components/DialogUpdate.tsx index 7923669a3e..e3af3b1ecf 100644 --- a/ts/components/DialogUpdate.tsx +++ b/ts/components/DialogUpdate.tsx @@ -2,7 +2,6 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import formatFileSize from 'filesize'; import { isBeta } from '../util/version'; import { DialogType } from '../types/Dialogs'; @@ -11,6 +10,7 @@ import { PRODUCTION_DOWNLOAD_URL, BETA_DOWNLOAD_URL } from '../types/support'; import { Intl } from './Intl'; import { LeftPaneDialog } from './LeftPaneDialog'; import type { WidthBreakpoint } from './_util'; +import { formatFileSize } from '../util/formatFileSize'; export type PropsType = { containerWidthBreakpoint: WidthBreakpoint; @@ -195,7 +195,7 @@ export function DialogUpdate({ (dialogType === DialogType.DownloadReady || dialogType === DialogType.FullDownloadReady) ) { - title += ` (${formatFileSize(downloadSize, { round: 0 })})`; + title += ` (${formatFileSize(downloadSize)})`; } let clickLabel = i18n('icu:autoUpdateNewVersionMessage'); diff --git a/ts/components/StoryDetailsModal.tsx b/ts/components/StoryDetailsModal.tsx index 6e255fc9de..ba499f91e4 100644 --- a/ts/components/StoryDetailsModal.tsx +++ b/ts/components/StoryDetailsModal.tsx @@ -2,7 +2,6 @@ // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; -import formatFileSize from 'filesize'; import type { LocalizerType } from '../types/Util'; import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; import type { StorySendStateType, StoryViewType } from '../types/Stories'; @@ -21,6 +20,7 @@ import { ThemeType } from '../types/Util'; import { Time } from './Time'; import { groupBy } from '../util/mapUtil'; import { format as formatRelativeTime } from '../util/expirationTimer'; +import { formatFileSize } from '../util/formatFileSize'; export type PropsType = { getPreferredBadge: PreferredBadgeSelectorType; diff --git a/ts/components/conversation/media-gallery/DocumentListItem.tsx b/ts/components/conversation/media-gallery/DocumentListItem.tsx index 8975aebae9..1cce4bef9b 100644 --- a/ts/components/conversation/media-gallery/DocumentListItem.tsx +++ b/ts/components/conversation/media-gallery/DocumentListItem.tsx @@ -5,7 +5,7 @@ import React from 'react'; import classNames from 'classnames'; import moment from 'moment'; -import formatFileSize from 'filesize'; +import { formatFileSize } from '../../../util/formatFileSize'; export type Props = { // Required @@ -43,9 +43,7 @@ export function DocumentListItem({ {fileName} - {typeof fileSize === 'number' - ? formatFileSize(fileSize, { round: 0 }) - : ''} + {typeof fileSize === 'number' ? formatFileSize(fileSize) : ''}