From fd61e0681d1b14751a24edf440f1df426f76cb78 Mon Sep 17 00:00:00 2001 From: Paola De Bartolo Date: Tue, 29 Jul 2025 15:55:42 -0300 Subject: [PATCH] fix: replace button text on new X driver Text should be "X" instead of "X.com". Close #13 --- .../resources/frontend/src/fc-sharee-connector.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/resources/META-INF/resources/frontend/src/fc-sharee-connector.js b/src/main/resources/META-INF/resources/frontend/src/fc-sharee-connector.js index ce1983d..2fc0f6d 100644 --- a/src/main/resources/META-INF/resources/frontend/src/fc-sharee-connector.js +++ b/src/main/resources/META-INF/resources/frontend/src/fc-sharee-connector.js @@ -22,12 +22,14 @@ import Sharee from 'sharee'; window.fcShareeConnector = { create: function (container, optionsJson) { + this._updateXButtonLabel(); this._updateCopyDriverOnClick(); let parsedOptions = JSON.parse(optionsJson); const sharee = new Sharee(container, parsedOptions); }, createWithCustomDrivers: function (container, optionsJson) { + this._updateXButtonLabel(); this._updateCopyDriverOnClick(); let parsedOptions = JSON.parse(optionsJson); // add the custom drivers to the list of drivers @@ -114,5 +116,14 @@ window.fcShareeConnector = { }, 5000) }); } - } + }, + + /* + * Workaround to X driver button text to show only "X" instead "X.com" as in the base component. + */ + _updateXButtonLabel() { + Sharee.drivers['x'].prototype.getButtonText = function () { + return "X"; + } + } }