decord/source/modules/stickers/native/StickersUtils.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

83 lines
3.2 KiB
TypeScript

// Module ID: 10389
// Function ID: 10390
// Name: useStickerCategories
// Dependencies: [19, 17, 1979, 1371, 10390, 1074, 1219, 10387, 5268, 10391, 10392, 1609, 2]
// Exports: dropPreloadedSticker, openStickerPickerToPackId, preloadSticker, useStickerCategories
// Module 10389 (useStickerCategories)
import closure_3 from "noop" /* 19 */;
import { NativeModules } from "get ActivityIndicator" /* 17 */;
import closure_5 from "createGuildRecordFromRust" /* 1979 */;
import closure_6 from "mergeGuildAvatar" /* 1371 */;
import { useStickerPickerStore } from "useStickerPickerStore" /* 10390 */;
import { GuildNSFWContentLevel } from "ME" /* 1074 */;
import { ExpressionPickerViewType } from "ExpressionPickerViewType" /* 1219 */;
const require = arg1;
const result = require("set").fileFinishedImporting("modules/stickers/native/StickersUtils.tsx");
export const useStickerCategories = function useStickerCategories(channel) {
stickerPackCategories = stickerPackCategories(guilds[7]).useStickerPackCategories(channel);
currentUser = currentUser.getCurrentUser();
guilds = guilds.getGuilds();
const items = [guilds, stickerPackCategories, currentUser];
return React.useMemo(() => {
const found = stickerPackCategories.filter((stickers) => stickers.stickers.length > 0);
const found1 = found.filter((type) => {
let tmp2 = type.type !== closure_1_0(closure_1_2[8]).StickerCategoryTypes.GUILD;
if (!tmp2) {
let nsfwAllowed;
if (lib != null) {
nsfwAllowed = lib.nsfwAllowed;
}
tmp2 = nsfwAllowed;
}
if (!tmp2) {
tmp2 = null == tmp;
}
if (!tmp2) {
tmp2 = tmp.nsfwLevel !== closure_1_8.AGE_RESTRICTED && tmp.nsfwLevel !== tmp6.EXPLICIT;
const tmp7 = tmp.nsfwLevel !== closure_1_8.AGE_RESTRICTED && tmp.nsfwLevel !== tmp6.EXPLICIT;
}
return tmp2;
});
return found1.map((type) => {
if (type.type !== callback(5268).StickerCategoryTypes.FAVORITE) {
if (type.type !== tmp(5268).StickerCategoryTypes.RECENT) {
return type;
}
}
if (type.type === callback(5268).StickerCategoryTypes.FAVORITE) {
let tmp4 = lib(10391);
} else {
tmp4 = lib(10392);
}
const obj = {};
const merged = Object.assign(type);
obj.icon = tmp4;
return obj;
});
}, items);
};
export const preloadSticker = function preloadSticker(hash) {
const NativeLottieUtils = NativeModules.NativeLottieUtils;
NativeLottieUtils.preload(hash.hash, hash.url, hash.width, hash.height, hash.frames, hash.callback);
};
export const dropPreloadedSticker = function dropPreloadedSticker(arg0) {
const NativeLottieUtils = NativeModules.NativeLottieUtils;
NativeLottieUtils.dropPreload(arg0);
};
export const openStickerPickerToPackId = function openStickerPickerToPackId(arg0, pack_id) {
closure_0 = arg0;
const state = useStickerPickerStore.getState();
state.setPackToScrollTo(pack_id);
const timerId = setTimeout(() => {
const current = ref.current;
if (current != null) {
const obj = { type: null, context: null };
obj[0] = ref(closure_1_2[11]).KeyboardTypes.EXPRESSION;
obj[1] = closure_1_9.STICKER;
current.openCustomKeyboard(obj);
}
}, 1);
};