Browse Source

Fix country picker emoji

master
Eduard Kuzmenko 3 years ago
parent
commit
d2d140598a
  1. 7
      src/lib/richtextprocessor.ts
  2. 15
      src/pages/pageSignIn.ts

7
src/lib/richtextprocessor.ts

@ -410,13 +410,14 @@ namespace RichTextProcessor { @@ -410,13 +410,14 @@ namespace RichTextProcessor {
noLinebreaks: true,
noCommands: true,
wrappingDraft: true,
//mustWrapEmoji: boolean,
fromBot: boolean,
noTextFormat: true,
passEntities: Partial<{
[_ in MessageEntity['_']]: boolean
}>,
contextHashtag?: string
contextHashtag?: string,
}> = {}) {
if(!text) {
return '';
@ -540,7 +541,9 @@ namespace RichTextProcessor { @@ -540,7 +541,9 @@ namespace RichTextProcessor {
// } else {
insertPart(entity, `<img src="assets/img/emoji/${entity.unicode}.png" alt="`, `" class="emoji">`);
// }
}
}/* else if(options.mustWrapEmoji) {
insertPart(entity, '<span class="emoji">', '</span>');
} */
/* if(!emojiSupported) {
insertPart(entity, `<img src="assets/img/emoji/${entity.unicode}.png" alt="`, `" class="emoji">`);
} */

15
src/pages/pageSignIn.ts

@ -94,13 +94,16 @@ let onFirstMount = () => { @@ -94,13 +94,16 @@ let onFirstMount = () => {
const liArr: Array<HTMLLIElement> = [];
c.phoneCode.split(' and ').forEach((phoneCode: string) => {
const li = document.createElement('li');
const spanEmoji = document.createElement('span');
const kek = RichTextProcessor.wrapRichText(emoji);
li.appendChild(spanEmoji);
spanEmoji.outerHTML = kek;
let wrapped = RichTextProcessor.wrapEmojiText(emoji);
if(RichTextProcessor.emojiSupported) {
const spanEmoji = document.createElement('span');
spanEmoji.innerHTML = wrapped;
li.append(spanEmoji);
} else {
li.innerHTML = wrapped;
}
li.append(c.name);
const span = document.createElement('span');

Loading…
Cancel
Save