FIX: ensures diversity code is not applied multiple times (#10517)
This commit is contained in:
parent
265d8bc1d7
commit
b6dd3eca9a
|
@ -176,7 +176,10 @@ export default Component.extend({
|
|||
return false;
|
||||
}
|
||||
|
||||
this.set("hoveredEmoji", event.target.title);
|
||||
this.set(
|
||||
"hoveredEmoji",
|
||||
this._codeWithDiversity(event.target.title, this.selectedDiversity)
|
||||
);
|
||||
},
|
||||
|
||||
@action
|
||||
|
@ -241,7 +244,9 @@ export default Component.extend({
|
|||
},
|
||||
|
||||
_codeWithDiversity(code, selectedDiversity) {
|
||||
if (selectedDiversity !== 0 && isSkinTonableEmoji(code)) {
|
||||
if (/:t\d/.test(code)) {
|
||||
return code;
|
||||
} else if (selectedDiversity !== 0 && isSkinTonableEmoji(code)) {
|
||||
return `${code}:t${selectedDiversity + 1}`;
|
||||
} else {
|
||||
return code;
|
||||
|
|
Loading…
Reference in New Issue