refactor
This commit is contained in:
parent
002f98987d
commit
890564e1da
1 changed files with 4 additions and 1 deletions
|
@ -62,6 +62,7 @@ type EmojiDef = {
|
||||||
const lib = emojilist.filter(x => x.category !== 'flags');
|
const lib = emojilist.filter(x => x.category !== 'flags');
|
||||||
|
|
||||||
const emojiDb = computed(() => {
|
const emojiDb = computed(() => {
|
||||||
|
//#region Unicode Emoji
|
||||||
const char2path = defaultStore.reactiveState.emojiStyle.value === 'twemoji' ? char2twemojiFilePath : char2fluentEmojiFilePath;
|
const char2path = defaultStore.reactiveState.emojiStyle.value === 'twemoji' ? char2twemojiFilePath : char2fluentEmojiFilePath;
|
||||||
|
|
||||||
const unicodeEmojiDB: EmojiDef[] = lib.map(x => ({
|
const unicodeEmojiDB: EmojiDef[] = lib.map(x => ({
|
||||||
|
@ -84,8 +85,9 @@ const emojiDb = computed(() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
unicodeEmojiDB.sort((a, b) => a.name.length - b.name.length);
|
unicodeEmojiDB.sort((a, b) => a.name.length - b.name.length);
|
||||||
|
//#endregion
|
||||||
|
|
||||||
//#region Construct Emoji DB
|
//#region Custom Emoji
|
||||||
const customEmojiDB: EmojiDef[] = [];
|
const customEmojiDB: EmojiDef[] = [];
|
||||||
|
|
||||||
for (const x of customEmojis.value) {
|
for (const x of customEmojis.value) {
|
||||||
|
@ -108,6 +110,7 @@ const emojiDb = computed(() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
customEmojiDB.sort((a, b) => a.name.length - b.name.length);
|
customEmojiDB.sort((a, b) => a.name.length - b.name.length);
|
||||||
|
//#endregion
|
||||||
|
|
||||||
return markRaw([ ...customEmojiDB, ...unicodeEmojiDB ]);
|
return markRaw([ ...customEmojiDB, ...unicodeEmojiDB ]);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue