Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4824.js (118.4 MB)
140 lines
5.7 KiB
TypeScript
140 lines
5.7 KiB
TypeScript
// Module ID: 16369
|
|
// Function ID: 16370
|
|
// Name: useChannelNoticeRows
|
|
// Dependencies: [32, 19, 12610, 2013, 1980, 1372, 7641, 1074, 1955, 563, 7270, 7272, 16370, 7495, 1944, 4460, 16294, 16371, 2]
|
|
// Exports: default
|
|
|
|
// Module 16369 (useChannelNoticeRows)
|
|
import dismissible_content from "dismissible_content" /* 1944 */;
|
|
import DismissibleContentUnsafeUtils from "DismissibleContentUnsafeUtils" /* 4460 */;
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
import noop from "module_19" /* 19 */;
|
|
import GuildProgressStore from "GuildProgressStore" /* 12610 */;
|
|
import GuildChannelStore from "GuildChannelStore" /* 2013 */;
|
|
import GuildStore from "GuildStore" /* 1980 */;
|
|
import UserStore from "UserStore" /* 1372 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
require = fn;
|
|
let closure_9 = fn(7641).ChannelListChannelNoticeRow;
|
|
const MFALevels = fn(1074).MFALevels;
|
|
const DismissibleContentConstants = fn(1955);
|
|
({ ContentDismissActionType: closure_11, DismissibleContentGroupName: closure_12 } = DismissibleContentConstants);
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/guild_sidebar/native/useChannelNoticeRows.tsx");
|
|
|
|
export default function useChannelNoticeRows(id) {
|
|
_require = id;
|
|
id = id.id;
|
|
let items = [guildHasLiveChannelNotice];
|
|
stateFromStores = require("useStateFromStores").useStateFromStores(items, () => GuildProgressStore.hasProgress(id));
|
|
const currentUser = UserStore.getCurrentUser();
|
|
let obj = require("useStateFromStores");
|
|
const items1 = [closure_6];
|
|
const items2 = [currentUser, id.mfaLevel, id];
|
|
const stateFromStores1 = require("useStateFromStores").useStateFromStores(items1, () => {
|
|
let result = null != currentUser;
|
|
if (result) {
|
|
result = guildId.mfaLevel === MFALevels.ELEVATED;
|
|
}
|
|
if (result) {
|
|
result = !currentUser.mfaEnabled;
|
|
}
|
|
if (result) {
|
|
result = GuildChannelStore.hasElevatedPermissions(id);
|
|
}
|
|
return result;
|
|
}, items2);
|
|
let obj2 = require("useStateFromStores");
|
|
guildHasLiveChannelNotice = require("useGuildHasLiveChannelNotice").useGuildHasLiveChannelNotice(id);
|
|
const obj3 = require("useGuildHasLiveChannelNotice");
|
|
const canShowGameClaimCoachmark = require("useGameClaimCoachmark").useCanShowGameClaimCoachmark(id);
|
|
const obj4 = require("useGameClaimCoachmark");
|
|
if (canShowGameClaimCoachmark) {
|
|
const items3 = [tmp(tmp2[14]).DismissibleContent.GAME_CLAIM_COACHMARK];
|
|
let items4 = items3;
|
|
} else {
|
|
items4 = [];
|
|
}
|
|
const tmp10 = currentUser(require("useSelectedDismissibleContent").useSelectedSingleUseGuildDismissibleContent(items4, id, constants2.CHANNEL_NOTICES, true), 2);
|
|
closure_6 = tmp11;
|
|
closure_129_0 = id;
|
|
const obj5 = require("useSelectedDismissibleContent");
|
|
const tmp8 = constants2;
|
|
const tmp9 = currentUser;
|
|
const items5 = [closure_7];
|
|
const tmpResult = require("useStateFromStores");
|
|
const tmp12 = id(stateFromStores[11])(require("ApplicationActionCreators").useApplication(tmpResult.useStateFromStoresArray(items5, () => {
|
|
const guild = GuildStore.getGuild(closure_0);
|
|
let gameApplicationIds;
|
|
if (guild != null) {
|
|
gameApplicationIds = guild.gameApplicationIds;
|
|
}
|
|
if (gameApplicationIds == null) {
|
|
gameApplicationIds = [];
|
|
}
|
|
return gameApplicationIds;
|
|
})[0]).data);
|
|
({ fetched, hasAlreadyLinked } = tmp12);
|
|
closure_129_1 = hasAlreadyLinked;
|
|
({ connectionApp, canStartAuthorization, startAuthorization } = tmp12);
|
|
const tmpResult4 = require("ApplicationActionCreators");
|
|
const defaultAuthorizationNotifiers = require("useDefaultAuthorizationNotifiers").useDefaultAuthorizationNotifiers(startAuthorization, hasAlreadyLinked);
|
|
if (fetched) {
|
|
fetched = !hasAlreadyLinked;
|
|
}
|
|
if (fetched) {
|
|
fetched = canStartAuthorization;
|
|
}
|
|
if (fetched) {
|
|
fetched = null != connectionApp;
|
|
}
|
|
if (fetched) {
|
|
fetched = null != connectionApp.applicationAccountLinkBenefitConfig;
|
|
}
|
|
if (fetched) {
|
|
fetched = null != connectionApp.applicationAccountLinkBenefitConfig.reward_name;
|
|
}
|
|
if (fetched) {
|
|
fetched = null != connectionApp.applicationAccountLinkBenefitConfig.reward_image;
|
|
}
|
|
const tmpResult5 = require("useDefaultAuthorizationNotifiers");
|
|
if (fetched) {
|
|
const items6 = [tmp(tmp2[14]).DismissibleContent.MOBILE_ACCOUNT_LINKING_BANNER];
|
|
let items7 = items6;
|
|
} else {
|
|
items7 = [];
|
|
}
|
|
const tmpResult6 = require("useSelectedDismissibleContent");
|
|
const items8 = [id, hasAlreadyLinked];
|
|
[tmp15, tmp16] = tmp9(require("useSelectedDismissibleContent").useSelectedSingleUseGuildDismissibleContent(items7, id, tmp8.CHANNEL_NOTICES, true), 2);
|
|
const effect = stateFromStores1.useEffect(() => {
|
|
if (id) {
|
|
const obj2 = { dismissAction: constants.INDIRECT_ACTION, guildId, groupName: constants2.CHANNEL_NOTICES };
|
|
const result = DismissibleContentUnsafeUtils.UNSAFE_markSingleUseGuildDismissibleContentAsDismissed(dismissible_content.DismissibleContent.MOBILE_ACCOUNT_LINKING_BANNER, guildId, obj2);
|
|
}
|
|
}, items8);
|
|
closure_7 = tmp18;
|
|
const obj6 = { rows: null, gameClaimMarkAsDismissed: tmp10[1], applicationAccountLinkMarkAsDismissed: tmp16, startApplicationAccountLinkAuthorization: defaultAuthorizationNotifiers, accountLinkApplication: connectionApp };
|
|
const items9 = [stateFromStores, stateFromStores1, guildHasLiveChannelNotice, null != tmp10[0], null != tmp15];
|
|
obj6.rows = stateFromStores1.useMemo(() => {
|
|
const items = [constants.SPACER];
|
|
if (closure_6) {
|
|
items.push(tmp.GAME_CLAIM);
|
|
}
|
|
if (closure_7) {
|
|
items.push(tmp.APPLICATION_ACCOUNT_LINK);
|
|
}
|
|
if (stateFromStores) {
|
|
items.push(tmp.GUILD_PROGRESS);
|
|
} else if (stateFromStores1) {
|
|
items.push(tmp.MFA_WARNING);
|
|
}
|
|
if (guildHasLiveChannelNotice) {
|
|
items.push(tmp.LIVE_CHANNEL_NOTICE);
|
|
}
|
|
return items;
|
|
}, items9);
|
|
return obj6;
|
|
};
|