decord/alpha/source/modules/age_gate/useIsNsfwGated.tsx
github-actions 52331fb8ae chore: update source for alpha 349.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5051.js (118.4 MB)
2026-09-30 07:29:52 +00:00

40 lines
1.1 KiB
TypeScript

// Module ID: 7505
// Function ID: 7506
// Name: useIsNsfwGated
// Dependencies: [5077, 1372, 504, 2]
// Exports: default
// Module 7505 (useIsNsfwGated)
import GuildNSFWAgreeStore from "GuildNSFWAgreeStore" /* 5077 */;
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;
};