decord/source/modules/age_gate/useIsNsfwGated.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

40 lines
1.1 KiB
TypeScript

// Module ID: 7936
// Function ID: 7937
// Name: useIsNsfwGated
// Dependencies: [4817, 1371, 504, 2]
// Exports: default
// Module 7936 (useIsNsfwGated)
import GuildNSFWAgreeStore from "GuildNSFWAgreeStore" /* 4817 */;
import UserStore from "UserStore" /* 1371 */;
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;
};