mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33:41 -05:00
web/emojipicker: don't include sticker-only packs in emoji picker and vice versa
This commit is contained in:
parent
6e25cc7f20
commit
316fcc5bbd
2 changed files with 4 additions and 4 deletions
|
@ -145,7 +145,7 @@ export function usePreference<T extends keyof Preferences>(
|
|||
}
|
||||
|
||||
export function useCustomEmojis(
|
||||
ss: StateStore, room: RoomStateStore,
|
||||
ss: StateStore, room: RoomStateStore, usage: "stickers" | "emojis" = "emojis",
|
||||
): CustomEmojiPack[] {
|
||||
const personalPack = useSyncExternalStore(
|
||||
ss.accountDataSubs.getSubscriber("im.ponies.user_emotes"),
|
||||
|
@ -164,6 +164,6 @@ export function useCustomEmojis(
|
|||
if (personalPack) {
|
||||
allPacksObject.personal = personalPack
|
||||
}
|
||||
return Object.values(allPacksObject)
|
||||
}, [personalPack, watchedRoomPacks, specialRoomPacks])
|
||||
return Object.values(allPacksObject).filter(pack => pack[usage].length > 0)
|
||||
}, [personalPack, watchedRoomPacks, specialRoomPacks, usage])
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ const StickerPicker = ({ style, onSelect, room }: MediaPickerProps) => {
|
|||
const [query, setQuery] = useState("")
|
||||
const [emojiCategoryBarRef, emojiListRef] = useCategoryUnderline()
|
||||
const watchedEmojiPackKeys = client.store.getEmojiPackKeys().map(roomStateGUIDToString)
|
||||
const customEmojiPacks = useCustomEmojis(client.store, room)
|
||||
const customEmojiPacks = useCustomEmojis(client.store, room, "stickers")
|
||||
const emojis = useFilteredEmojis(query, {
|
||||
// frequentlyUsed: client.store.frequentlyUsedStickers,
|
||||
customEmojiPacks,
|
||||
|
|
Loading…
Add table
Reference in a new issue