mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-16 16:47:24 +00:00
fix: show emoji in reaction tooltip
Fixes: #2387. Shows the emoji in the emoji reaction tooltip instead of the shorthand (ie 👎 instead of `👎`).
This commit is contained in:
parent
9493839b65
commit
65a0cfbcd3
@ -46,16 +46,11 @@ Item {
|
|||||||
|
|
||||||
//% " reacted with "
|
//% " reacted with "
|
||||||
tooltip += qsTrId("-reacted-with-");
|
tooltip += qsTrId("-reacted-with-");
|
||||||
|
let emojiHtml = Emoji.getEmojiFromId(emojiId);
|
||||||
switch (emojiId) {
|
if (emojiHtml) {
|
||||||
case 1: return tooltip + ":heart:"
|
tooltip += emojiHtml;
|
||||||
case 2: return tooltip + ":thumbsup:"
|
|
||||||
case 3: return tooltip + ":thumbsdown:"
|
|
||||||
case 4: return tooltip + ":laughing:"
|
|
||||||
case 5: return tooltip + ":cry:"
|
|
||||||
case 6: return tooltip + ":angry:"
|
|
||||||
default: return tooltip
|
|
||||||
}
|
}
|
||||||
|
return tooltip
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
@ -71,4 +71,25 @@ QtObject {
|
|||||||
})
|
})
|
||||||
return String.fromCodePoint(...codePointParts);
|
return String.fromCodePoint(...codePointParts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getShortcodeFromId(emojiId) {
|
||||||
|
switch (emojiId) {
|
||||||
|
case 1: return ":heart:"
|
||||||
|
case 2: return ":thumbsup:"
|
||||||
|
case 3: return ":thumbsdown:"
|
||||||
|
case 4: return ":laughing:"
|
||||||
|
case 5: return ":cry:"
|
||||||
|
case 6: return ":angry:"
|
||||||
|
default: return undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getEmojiFromId(emojiId) {
|
||||||
|
let shortcode = Emoji.getShortcodeFromId(emojiId)
|
||||||
|
let emojiUnicode = Emoji.getEmojiUnicode(shortcode)
|
||||||
|
if (emojiUnicode) {
|
||||||
|
return Emoji.fromCodePoint(emojiUnicode)
|
||||||
|
}
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user