forked from Mirrors/gomuks
web/statestore: ignore packs with no images
This commit is contained in:
parent
d9d0718bc6
commit
64f9fccfd7
2 changed files with 2 additions and 2 deletions
|
@ -206,7 +206,7 @@ export class StateStore {
|
||||||
getPersonalEmojiPack(): CustomEmojiPack | null {
|
getPersonalEmojiPack(): CustomEmojiPack | null {
|
||||||
if (this.#personalEmojiPack === null) {
|
if (this.#personalEmojiPack === null) {
|
||||||
const pack = this.accountData.get("im.ponies.user_emotes")
|
const pack = this.accountData.get("im.ponies.user_emotes")
|
||||||
if (!pack) {
|
if (!pack || !pack.images) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
this.#personalEmojiPack = parseCustomEmojiPack(pack as ImagePack, "personal", "Personal pack")
|
this.#personalEmojiPack = parseCustomEmojiPack(pack as ImagePack, "personal", "Personal pack")
|
||||||
|
|
|
@ -120,7 +120,7 @@ export class RoomStateStore {
|
||||||
getEmojiPack(key: string): CustomEmojiPack | null {
|
getEmojiPack(key: string): CustomEmojiPack | null {
|
||||||
if (!this.emojiPacks.has(key)) {
|
if (!this.emojiPacks.has(key)) {
|
||||||
const pack = this.getStateEvent("im.ponies.room_emotes", key)?.content
|
const pack = this.getStateEvent("im.ponies.room_emotes", key)?.content
|
||||||
if (!pack) {
|
if (!pack || !pack.images) {
|
||||||
this.emojiPacks.set(key, null)
|
this.emojiPacks.set(key, null)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue