diff --git a/public/scripts/ui.js b/public/scripts/ui.js index 0ab425f..69cc23a 100644 --- a/public/scripts/ui.js +++ b/public/scripts/ui.js @@ -695,20 +695,20 @@ class ReceiveDialog extends Dialog { } _parseFileData(displayName, connectionHash, files, imagesOnly, totalSize) { - if (files.length > 1) { - let fileOther; - if (files.length === 2) { - fileOther = imagesOnly - ? Localization.getTranslation("dialogs.file-other-description-image") - : Localization.getTranslation("dialogs.file-other-description-file"); - } else { - fileOther = imagesOnly - ? Localization.getTranslation("dialogs.file-other-description-image-plural", null, {count: files.length - 1}) - : Localization.getTranslation("dialogs.file-other-description-file-plural", null, {count: files.length - 1}); - } - this.$fileOther.innerText = fileOther; + let fileOther = ""; + + if (files.length === 2) { + fileOther = imagesOnly + ? Localization.getTranslation("dialogs.file-other-description-image") + : Localization.getTranslation("dialogs.file-other-description-file"); + } else if (files.length >= 2) { + fileOther = imagesOnly + ? Localization.getTranslation("dialogs.file-other-description-image-plural", null, {count: files.length - 1}) + : Localization.getTranslation("dialogs.file-other-description-file-plural", null, {count: files.length - 1}); } + this.$fileOther.innerText = fileOther; + const fileName = files[0].name; const fileNameSplit = fileName.split('.'); const fileExtension = '.' + fileNameSplit[fileNameSplit.length - 1]; diff --git a/public_included_ws_fallback/scripts/ui.js b/public_included_ws_fallback/scripts/ui.js index edba81e..c5eb462 100644 --- a/public_included_ws_fallback/scripts/ui.js +++ b/public_included_ws_fallback/scripts/ui.js @@ -696,20 +696,20 @@ class ReceiveDialog extends Dialog { } _parseFileData(displayName, connectionHash, files, imagesOnly, totalSize) { - if (files.length > 1) { - let fileOther; - if (files.length === 2) { - fileOther = imagesOnly - ? Localization.getTranslation("dialogs.file-other-description-image") - : Localization.getTranslation("dialogs.file-other-description-file"); - } else { - fileOther = imagesOnly - ? Localization.getTranslation("dialogs.file-other-description-image-plural", null, {count: files.length - 1}) - : Localization.getTranslation("dialogs.file-other-description-file-plural", null, {count: files.length - 1}); - } - this.$fileOther.innerText = fileOther; + let fileOther = ""; + + if (files.length === 2) { + fileOther = imagesOnly + ? Localization.getTranslation("dialogs.file-other-description-image") + : Localization.getTranslation("dialogs.file-other-description-file"); + } else if (files.length >= 2) { + fileOther = imagesOnly + ? Localization.getTranslation("dialogs.file-other-description-image-plural", null, {count: files.length - 1}) + : Localization.getTranslation("dialogs.file-other-description-file-plural", null, {count: files.length - 1}); } + this.$fileOther.innerText = fileOther; + const fileName = files[0].name; const fileNameSplit = fileName.split('.'); const fileExtension = '.' + fileNameSplit[fileNameSplit.length - 1];