decord/alpha/source/modules/age_gate/useIsNsfwGated.tsx
github-actions 6eea20b8e1 chore: update source for alpha 348.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5014.js (118.4 MB)
2026-09-24 10:59:02 +00:00

40 lines
1.1 KiB
TypeScript

// Module ID: 8215
// Function ID: 8216
// Name: useIsNsfwGated
// Dependencies: [5040, 1372, 504, 2]
// Exports: default
// Module 8215 (useIsNsfwGated)
import GuildNSFWAgreeStore from "GuildNSFWAgreeStore" /* 5040 */;
import UserStore from "UserStore" /* 1372 */;
const require = globalThis.__r;
const require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/age_gate/useIsNsfwGated.tsx");
export default function useIsNsfwGated(nsfw) {
_require = nsfw;
nsfw = nsfw.nsfw;
const items = [UserStore];
const stateFromStores = require("initialize").useStateFromStores(items, () => {
currentUser = currentUser.getCurrentUser();
let nsfwAllowed;
if (currentUser != null) {
nsfwAllowed = currentUser.nsfwAllowed;
}
return nsfwAllowed;
});
const obj = require("initialize");
const items1 = [GuildNSFWAgreeStore];
const stateFromStores1 = require("initialize").useStateFromStores(items1, () => GuildNSFWAgreeStore.didAgree(nsfw.guild_id));
let tmp3 = !stateFromStores1;
if (nsfw) {
if (stateFromStores1) {
tmp3 = false === stateFromStores;
}
nsfw = tmp3;
}
return nsfw;
};