remove fav emoji welcome message

pull/83/head
Aevann 2022-12-30 10:24:14 +02:00
parent a42f0ffb81
commit 49ab7ab36a
2 changed files with 0 additions and 21 deletions

View File

@ -29,7 +29,6 @@ const emojiSelectPostfixDOMs= document.getElementsByClassName("emoji-postfix");
const emojiNotFoundDOM = document.getElementById("no-emojis-found");
const emojiWorkingDOM = document.getElementById("emojis-work");
const emojiNewUserDOM = document.getElementById("emoji-new-user");
/** @type {HTMLInputElement} */
const emojiSearchBarDOM = document.getElementById('emoji_search');
@ -39,9 +38,6 @@ let emojiInputTargetDOM = undefined;
// Emojis usage stats. I don't really like this format but I'll keep it for backward comp.
const favorite_emojis = JSON.parse(localStorage.getItem("favorite_emojis")) || {};
const emojiFirstBoot = Object.keys(favorite_emojis).length === 0;
emojiNewUserDOM.hidden = !emojiFirstBoot;
/** Associative array of all the emojis' DOM */
let emojiDOMs = {};
@ -76,8 +72,6 @@ let emojiSearcher = {
classesSelectorDOM.children[0].children[0].classList.add("active");
continue;
}
// Hide welcome message
emojiNewUserDOM.hidden = true;
// Search
const resultSet = emojisSearchDictionary.completeSearch(query);
@ -283,18 +277,9 @@ function switchEmojiTab(e)
// Special case: favorites
if(className === "favorite")
{
if(emojiFirstBoot)
emojiNewUserDOM.hidden = false;
for(const emojiDOM of Object.values(emojiDOMs))
emojiDOM.hidden = true;
// copied from the old one
// For new users we show anton-d's emojis
const favs = emojiFirstBoot ? emojisSearchDictionary.searchFor("anton-d") : Object.keys(Object.fromEntries(
Object.entries(favorite_emojis).sort(([,a],[,b]) => b-a)
)).slice(0, 25);
for (const emoji of favs)
if(emojiDOMs[emoji] instanceof HTMLElement)
emojiDOMs[emoji].hidden = false;
@ -302,8 +287,6 @@ function switchEmojiTab(e)
return;
}
emojiNewUserDOM.hidden = true;
for(const emojiDOM of Object.values(emojiDOMs))
emojiDOM.hidden = emojiDOM.dataset.className !== className;
}

View File

@ -45,10 +45,6 @@
<div id="emojis-work" class="tab-content py-3 pl-2">
I am working as hard as I can, sweaty... 🚴
</div>
<div id="emoji-new-user" class="tab-content py-3 pl-2" hidden>
👋 Hello! This is the first time you're using the emoji system on this device 📱.<br>
I've took the liberty to populate this tab with a selection of Anton's emojis 😽. Next time you'll find the ones you used the most in there 📚
</div>
<div id="tab-content" class="tab-content d-flex flex-wrap py-3 pl-2" hidden style="text-align:center;">
<template id="emoji-button-template">
<button type="button" class="btn m-1 px-0 emoji2" data-bs-toggle="tooltip" delay:="0">