diff --git a/client/src/javascript/components/general/WindowTitle.tsx b/client/src/javascript/components/general/WindowTitle.tsx index 7eca5438..33bd75d9 100644 --- a/client/src/javascript/components/general/WindowTitle.tsx +++ b/client/src/javascript/components/general/WindowTitle.tsx @@ -9,47 +9,36 @@ const WindowTitle: React.FC = () => { const {transferSummary: summary} = TransferDataStore; const intl = useIntl(); - React.useEffect(() => { - let title = 'Flood'; + let title = 'Flood'; - if (summary != null && Object.keys(summary).length > 0) { - const down = compute(summary.downRate); - const up = compute(summary.upRate); + if (summary != null && Object.keys(summary).length > 0) { + const down = compute(summary.downRate); + const up = compute(summary.upRate); - const formattedDownSpeed = intl.formatNumber(down.value); - const formattedUpSpeed = intl.formatNumber(up.value); + const formattedDownSpeed = intl.formatNumber(down.value); + const formattedUpSpeed = intl.formatNumber(up.value); - const translatedDownUnit = intl.formatMessage( - { - id: 'unit.speed', - }, - { - baseUnit: intl.formatMessage({id: getTranslationString(down.unit)}), - }, - ); - const translatedUpUnit = intl.formatMessage( - { - id: 'unit.speed', - }, - { - baseUnit: intl.formatMessage({id: getTranslationString(up.unit)}), - }, - ); + const translatedDownUnit = intl.formatMessage( + { + id: 'unit.speed', + }, + { + baseUnit: intl.formatMessage({id: getTranslationString(down.unit)}), + }, + ); + const translatedUpUnit = intl.formatMessage( + { + id: 'unit.speed', + }, + { + baseUnit: intl.formatMessage({id: getTranslationString(up.unit)}), + }, + ); - title = intl.formatMessage( - { - id: 'window.title', - // \u2193 and \u2191 are down and up arrows, respectively - }, - { - down: `${formattedDownSpeed} ${translatedDownUnit}`, - up: `${formattedUpSpeed} ${translatedUpUnit}`, - }, - ); - } + title = `↓ ${formattedDownSpeed} ${translatedDownUnit} ↑ ${formattedUpSpeed} ${translatedUpUnit} - Flood`; + } - document.title = title; - }, [intl, summary]); + document.title = title; return null; }; diff --git a/client/src/javascript/i18n/strings.compiled.json b/client/src/javascript/i18n/strings.compiled.json index ee46c39e..bf602831 100644 --- a/client/src/javascript/i18n/strings.compiled.json +++ b/client/src/javascript/i18n/strings.compiled.json @@ -2498,27 +2498,5 @@ "type": 0, "value": "yr" } - ], - "window.title": [ - { - "type": 0, - "value": "↓ " - }, - { - "type": 1, - "value": "down" - }, - { - "type": 0, - "value": " ↑ " - }, - { - "type": 1, - "value": "up" - }, - { - "type": 0, - "value": " - Flood" - } ] } diff --git a/client/src/javascript/i18n/strings.json b/client/src/javascript/i18n/strings.json index 79fc29d9..debf0afe 100644 --- a/client/src/javascript/i18n/strings.json +++ b/client/src/javascript/i18n/strings.json @@ -352,7 +352,6 @@ "status.diskusage.total": "Total", "locale.language.auto": "Automatic", "locale.language.translate": "Start to translate", - "window.title": "↓ {down} ↑ {up} - Flood", "dependency.loading.notifications": "Notifications", "dependency.loading.torrent.taxonomy": "Torrent Taxonomy", "dependency.loading.transfer.rate.details": "Data Transfer Rate Details",