Skip to content

Commit 32aebf4

Browse files
committed
refactor: display better label for "reply to all"
1 parent 198de75 commit 32aebf4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

extension/js/common/xss-safe-factory.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,15 @@ export class XssSafeFactory {
270270
};
271271

272272
public btnSecureMenuBtn = (replyOption: ReplyOption) => {
273-
const actionText = replyOption.replace('a_', '').replace('_', ' ');
274-
const action = {
275-
underscore: actionText.replace(' ', '_'),
276-
hyphen: actionText.replace(' ', '-'),
273+
const replyOptionText = replyOption.replace('a_', '').replace('_', ' ');
274+
const htmlAttrib = {
275+
className: replyOptionText.replace(' ', '_'),
276+
testName: replyOptionText.replace(' ', '-'),
277277
};
278+
const displayText = replyOptionText === 'reply all' ? replyOptionText.replace('all', 'to all') : replyOptionText;
278279
// * The action_${action.underscore}_message_button is used as an identifier in GmailElementReplacer.actionActivateSecureReplyHandler()
279-
return `<div class="action_${action.underscore}_message_button action_menu_message_button" data-test="action-${action.hyphen}-message-button">
280-
<img src="${this.srcImg(`svgs/${action.hyphen}-icon.svg`)}" /><span>secure ${actionText}</span>
280+
return `<div class="action_${htmlAttrib.className}_message_button action_menu_message_button" data-test="action-${htmlAttrib.testName}-message-button">
281+
<img src="${this.srcImg(`svgs/${htmlAttrib.testName}-icon.svg`)}" /><span>secure ${displayText}</span>
281282
</div>`;
282283
};
283284

0 commit comments

Comments
 (0)