Fix emoji picker
This commit is contained in:
parent
bde99dc242
commit
d766f9a0e3
7 changed files with 124 additions and 45 deletions
|
|
@ -12,6 +12,12 @@ import aesjs from "aes-js";
|
|||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import duration from "dayjs/plugin/duration";
|
||||
import i18n from "./lang";
|
||||
import {
|
||||
toRaw,
|
||||
isRef,
|
||||
isReactive,
|
||||
isProxy,
|
||||
} from 'vue';
|
||||
|
||||
export const STATE_EVENT_ROOM_DELETION_NOTICE = "im.keanu.room_deletion_notice";
|
||||
export const STATE_EVENT_ROOM_DELETED = "im.keanu.room_deleted";
|
||||
|
|
@ -782,10 +788,10 @@ class Util {
|
|||
|
||||
getDefaultAvatars() {
|
||||
var images = [];
|
||||
const modules = import.meta.glob("@/assets/avatars/*.{jpeg,jpg,png}", {
|
||||
query: '?url',
|
||||
import: 'default',
|
||||
eager: true
|
||||
const modules = import.meta.glob("@/assets/avatars/*.{jpeg,jpg,png}", {
|
||||
query: "?url",
|
||||
import: "default",
|
||||
eager: true,
|
||||
});
|
||||
Object.keys(modules).map((path) => {
|
||||
var name = path.split("_")[1];
|
||||
|
|
@ -1180,7 +1186,7 @@ class Util {
|
|||
* Possibly convert numerals to local representation (currently only for "bo" locale)
|
||||
* @param str String in which to convert numerals [0-9]
|
||||
* @returns converted string
|
||||
*/
|
||||
*/
|
||||
toLocalNumbers = (str) => {
|
||||
if (i18n.locale == "my") {
|
||||
// Translate to burmese numerals
|
||||
|
|
@ -1210,5 +1216,24 @@ class Util {
|
|||
|
||||
return str;
|
||||
};
|
||||
}
|
||||
|
||||
deepToRaw(sourceObj) {
|
||||
const objectIterator = (input) => {
|
||||
if (Array.isArray(input)) {
|
||||
return input.map((item) => objectIterator(item));
|
||||
}
|
||||
if (isRef(input) || isReactive(input) || isProxy(input)) {
|
||||
return objectIterator(toRaw(input));
|
||||
}
|
||||
if (input && typeof input === "object") {
|
||||
return Object.keys(input).reduce((acc, key) => {
|
||||
acc[key] = objectIterator(input[key]);
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
return input;
|
||||
};
|
||||
return objectIterator(sourceObj);
|
||||
}
|
||||
};
|
||||
export default new Util();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue