From 808797a48b6790a03927c53da5b4edcaf9c45889 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 17 Aug 2024 10:42:59 +0300 Subject: [PATCH] client: Fix double question mark in attachments context menu (see #306) --- .../widgets/buttons/attachments_actions.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/public/app/widgets/buttons/attachments_actions.js b/src/public/app/widgets/buttons/attachments_actions.js index a7bdf70ab..c7841f340 100644 --- a/src/public/app/widgets/buttons/attachments_actions.js +++ b/src/public/app/widgets/buttons/attachments_actions.js @@ -77,21 +77,24 @@ export default class AttachmentActionsWidget extends BasicWidget { } }); + const isElectron = utils.isElectron(); if (!this.isFullDetail) { const $openAttachmentButton = this.$widget.find("[data-trigger-command='openAttachment']"); $openAttachmentButton .addClass("disabled") .append($(' (?)') .attr("title", t('attachments_actions.open_externally_detail_page')) - ); - const $openAttachmentCustomButton = this.$widget.find("[data-trigger-command='openAttachmentCustom']"); - $openAttachmentCustomButton - .addClass("disabled") - .append($(' (?)') - .attr("title", t('attachments_actions.open_externally_detail_page')) - ); + ); + if (isElectron) { + const $openAttachmentCustomButton = this.$widget.find("[data-trigger-command='openAttachmentCustom']"); + $openAttachmentCustomButton + .addClass("disabled") + .append($(' (?)') + .attr("title", t('attachments_actions.open_externally_detail_page')) + ); + } } - if (!utils.isElectron()){ + if (!isElectron){ const $openAttachmentCustomButton = this.$widget.find("[data-trigger-command='openAttachmentCustom']"); $openAttachmentCustomButton .addClass("disabled")