decord/beta/source/modules/guild_space/canUseGuildSpace.tsx

124 lines
3.9 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 16:32:48 +00:00
// Module ID: 6929
// Function ID: 6930
// Name: canUseGuildSpace
2026-10-12 16:32:48 +00:00
// Dependencies: [2087, 4750, 1085, 558, 576, 504, 6930, 2]
2026-10-02 13:37:24 +00:00
// Exports: canUseGuildSpace, isGuildSpaceAdmin
2026-10-12 16:32:48 +00:00
// Module 6929 (canUseGuildSpace)
2026-10-07 22:43:51 +00:00
import Constants from "Constants" /* 1085 */;
2026-10-12 16:32:48 +00:00
import GuildStore from "GuildStore" /* 2087 */;
import PermissionStore from "PermissionStore" /* 4750 */;
2026-10-02 13:37:24 +00:00
import ReactCompilerGating_mod from "ReactCompilerGating" /* 558 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
const require = globalThis.__r;
2026-10-01 14:13:23 +00:00
let _require;
2026-10-01 14:13:23 +00:00
const Permissions = Constants.Permissions;
2026-10-02 13:37:24 +00:00
let ReactCompilerGating = ReactCompilerGating_mod;
2026-10-12 16:32:48 +00:00
const tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useIsGuildSpaceAdmin(arg0) {
2026-10-02 13:37:24 +00:00
let closure_0;
let first;
let tmp6;
let tmp7;
_require = arg0;
const tmp = _require;
const obj = require("react");
const cResult = obj.c(4);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [PermissionStore];
cResult[0] = items;
first = items;
} else {
first = cResult[0];
}
if (cResult[1] !== arg0) {
2026-10-12 16:32:48 +00:00
const fn = function c() {
2026-10-02 13:37:24 +00:00
const canResult = null != closure_0 && PermissionStore.can(Permissions.MANAGE_GUILD, tmp);
return canResult;
};
const items1 = [arg0];
cResult[1] = arg0;
cResult[2] = fn;
cResult[3] = items1;
tmp7 = items1;
tmp6 = fn;
} else {
tmp6 = cResult[2];
tmp7 = cResult[3];
}
const tmpResult = tmp(504);
return tmpResult.useStateFromStores(first, tmp6, tmp7);
2026-10-12 16:32:48 +00:00
}) : (function useIsGuildSpaceAdmin(arg0) {
2026-10-01 14:13:23 +00:00
let closure_0;
_require = arg0;
const items = [PermissionStore];
const items1 = [arg0];
2026-10-01 14:13:23 +00:00
const obj = require("get initialized");
return obj.useStateFromStores(items, () => {
2026-10-02 13:37:24 +00:00
const canResult = null != closure_0 && PermissionStore.can(Permissions.MANAGE_GUILD, tmp);
return canResult;
}, items1);
2026-10-02 13:37:24 +00:00
});
let closure_5 = tmp2;
ReactCompilerGating = ReactCompilerGating_mod;
2026-10-12 16:32:48 +00:00
const tmp3 = ReactCompilerGating.isReactCompilerEnabled() ? (function useCanUseGuildSpace(arg0, arg1) {
2026-10-02 13:37:24 +00:00
let closure_0;
let first;
let tmp10;
let tmp9;
_require = arg0;
const obj = require("react");
const cResult = obj.c(7);
const useGuildSpaceExperimentEnabled = require("GuildSpaceExperiment").useGuildSpaceExperimentEnabled;
require("GuildSpaceExperiment");
const guildSpaceExperimentEnabled = useGuildSpaceExperimentEnabled(arg0, arg1);
2026-10-01 14:13:23 +00:00
const tmp = _require;
2026-10-02 13:37:24 +00:00
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [GuildStore];
cResult[0] = items;
first = items;
} else {
first = cResult[0];
}
if (cResult[1] !== arg0) {
const fn = function l() {
return GuildStore.getGuild(closure_0);
};
const items1 = [arg0];
cResult[1] = arg0;
cResult[2] = fn;
cResult[3] = items1;
tmp10 = items1;
tmp9 = fn;
} else {
tmp9 = cResult[2];
tmp10 = cResult[3];
}
const tmpResult = tmp(504);
closure_5(tmpResult.useStateFromStores(first, tmp9, tmp10));
return false;
2026-10-12 16:32:48 +00:00
}) : (function useCanUseGuildSpace(arg0, arg1) {
2026-10-02 13:37:24 +00:00
let closure_0;
_require = arg0;
2026-10-01 14:13:23 +00:00
const useGuildSpaceExperimentEnabled = require("GuildSpaceExperiment").useGuildSpaceExperimentEnabled;
2026-10-02 13:37:24 +00:00
require("GuildSpaceExperiment");
const guildSpaceExperimentEnabled = useGuildSpaceExperimentEnabled(arg0, arg1);
const items = [GuildStore];
2026-10-02 13:37:24 +00:00
const items1 = [arg0];
const tmpResult = require("get initialized");
closure_5(tmpResult.useStateFromStores(items, () => GuildStore.getGuild(closure_0), items1));
return false;
2026-10-02 13:37:24 +00:00
});
const result = size.fileFinishedImporting("modules/guild_space/canUseGuildSpace.tsx");
export const isGuildSpaceAdmin = function isGuildSpaceAdmin(arg0) {
const canResult = null != arg0 && PermissionStore.can(Permissions.MANAGE_GUILD, arg0);
return canResult;
};
2026-10-02 13:37:24 +00:00
export const useIsGuildSpaceAdmin = tmp2;
export function canUseGuildSpace(guild, getChannelIdForGuildTransition) {
return false;
}
export const useCanUseGuildSpace = tmp3;