139 lines
11 KiB
TypeScript
139 lines
11 KiB
TypeScript
/* Metro module 14728; source: modules/guild_sidebar/native/useChannelNoticeRows.tsx; dependencies: [57, 31, 11933, 1935, 1867, 1878, 5101, 661, 1376, 14579, 632, 6772, 6774, 14729, 7013, 1365, 3968, 14567, 14730, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import GuildChannelStore from '../../../stores/GuildChannelStore.tsx'; /* Metro dependency 1935 */
|
|
import GuildProgressStore from '../../guild_progress/GuildProgressStore.tsx'; /* Metro dependency 11933 */
|
|
import MobileAccountLinkingExperiment from '../../application_account_linking/experiments/mobileAccountLinkingExperiment.tsx'; /* Metro dependency 14579 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as UseStateFromStoresModule from '../../../external/discord_common/js/packages/flux/useStateFromStores.tsx'; /* Metro dependency 632 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as DismissibleContentConstantsModule from '../../dismissible_content/DismissibleContentConstants.tsx'; /* Metro dependency 1376 */
|
|
import * as GuildSidebarConstantsModule from '../GuildSidebarConstants.tsx'; /* Metro dependency 5101 */
|
|
import * as ApplicationActionCreatorsModule from '../../applications/ApplicationActionCreators.tsx'; /* Metro dependency 6772 */
|
|
import * as UseSelectedDismissibleContentModule from '../../dismissible_content/hooks/useSelectedDismissibleContent.tsx'; /* Metro dependency 7013 */
|
|
import * as UseGuildHasLiveChannelNoticeModule from '../../guild_scheduled_events/useGuildHasLiveChannelNotice.tsx'; /* Metro dependency 14567 */
|
|
import * as UseDefaultAuthorizationNotifiersModule from '../../application_account_linking/native/useDefaultAuthorizationNotifiers.tsx'; /* Metro dependency 14729 */
|
|
import * as UseGameClaimCoachmarkModule from '../../game_claim/useGameClaimCoachmark.tsx'; /* Metro dependency 14730 */
|
|
|
|
function _fun111041(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#111041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14925:6, offset: 0x023912e2, size: 277 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_sidebar/native/useChannelNoticeRows.tsx');
|
|
exports.default = useChannelNoticeRows;
|
|
function useChannelNoticeRows(a0) { // fn#111042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14925:383, offset: 0x023913f7, size: 462 bytes, params: 2, frame: 25
|
|
const env0_0 = a0;
|
|
const id = a0.id;
|
|
const value2 = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([GuildProgressStore],
|
|
function() {
|
|
return GuildProgressStore.hasProgress(id);
|
|
});
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const currentUser2 = currentUser;
|
|
const value4 = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([GuildChannelStore],
|
|
_fun111044, [currentUser, a0.mfaLevel, id]);
|
|
const env0_4 = value4;
|
|
const value5 = (UseGuildHasLiveChannelNoticeModule).useGuildHasLiveChannelNotice(id);
|
|
const value6 = (UseGameClaimCoachmarkModule).useCanShowGameClaimCoachmark(id);
|
|
const useSelectedSingleUseGuildDismissibleContent = UseSelectedDismissibleContentModule.useSelectedSingleUseGuildDismissibleContent;
|
|
const r4 = value6 ? [(require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.GAME_CLAIM_COACHMARK] : [];
|
|
const CHANNEL_NOTICES = DismissibleContentGroupName.CHANNEL_NOTICES;
|
|
const value8 = currentUser2(Reflect.apply(useSelectedSingleUseGuildDismissibleContent,
|
|
UseSelectedDismissibleContentModule, [r4, id, CHANNEL_NOTICES, true]), 2);
|
|
const property = value8[0];
|
|
const property2 = value8[1];
|
|
const value9 = property != null;
|
|
const {showApplicationAccountLink, applicationAccountLinkMarkAsDismissed, startApplicationAccountLinkAuthorization,
|
|
accountLinkApplication} = useMobileAccountLinkRow({guildId: id});
|
|
const binding = env0_4;
|
|
const useMemo = binding.useMemo;
|
|
return {rows: Reflect.apply(useMemo, binding, [_fun111048, [value2, value4, value5, value9,
|
|
showApplicationAccountLink]]), gameClaimMarkAsDismissed: property2,
|
|
applicationAccountLinkMarkAsDismissed: applicationAccountLinkMarkAsDismissed,
|
|
startApplicationAccountLinkAuthorization: startApplicationAccountLinkAuthorization,
|
|
accountLinkApplication: accountLinkApplication};
|
|
function _fun111044() { // fn#111044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14925:541, offset: 0x023915e2, size: 86 bytes, params: 1, frame: 12
|
|
return Module00057 != null && env0_0.mfaLevel === MFALevels.ELEVATED && !Module00057.mfaEnabled && GuildChannelStore.hasElevatedPermissions(id);
|
|
}
|
|
|
|
function useMobileAccountLinkRow({guildId}) { // fn#111045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14925:897, owner: useChannelNoticeRows.useMobileAccountLinkRow, offset: 0x02391638, size: 514 bytes, params: 2, frame: 26
|
|
const defaultImport = MobileAccountLinkingExperiment;
|
|
const useConfig = defaultImport.useConfig;
|
|
const enabled = Reflect.apply(useConfig, defaultImport, [{location: 'useMobileAccountLinkRow'}]).enabled;
|
|
const useStateFromStoresArray = UseStateFromStoresModule.useStateFromStoresArray;
|
|
let property = Reflect.apply(useStateFromStoresArray, UseStateFromStoresModule, [[GuildStore], _fun111046])[0];
|
|
const useApplication = ApplicationActionCreatorsModule.useApplication;
|
|
const {fetched, hasAlreadyLinked, canStartAuthorization, startAuthorization,
|
|
connectionApp} = (importDefault(6774) /* metro dependency 6774: useStartAuthorize */)(Reflect.apply(useApplication,
|
|
ApplicationActionCreatorsModule, [enabled ? property : null]).data);
|
|
const value5 = (UseDefaultAuthorizationNotifiersModule).useDefaultAuthorizationNotifiers(startAuthorization,
|
|
hasAlreadyLinked);
|
|
let r4 = enabled && fetched && !hasAlreadyLinked;
|
|
r4 = r4 && canStartAuthorization && connectionApp != null;
|
|
r4 = r4 && connectionApp.applicationAccountLinkBenefitConfig != null && connectionApp.applicationAccountLinkBenefitConfig.reward_name != null && connectionApp.applicationAccountLinkBenefitConfig.reward_image != null;
|
|
const useSelectedSingleUseGuildDismissibleContent = UseSelectedDismissibleContentModule.useSelectedSingleUseGuildDismissibleContent;
|
|
const r8 = r4 ? [(require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.MOBILE_ACCOUNT_LINKING_BANNER] : [];
|
|
const CHANNEL_NOTICES = DismissibleContentGroupName.CHANNEL_NOTICES;
|
|
const value12 = env1_3(Reflect.apply(useSelectedSingleUseGuildDismissibleContent,
|
|
UseSelectedDismissibleContentModule, [r8, guildId, CHANNEL_NOTICES, true]), 2);
|
|
property = value12[0];
|
|
const property2 = value12[1];
|
|
env1_4.useEffect(_fun111047, [guildId, hasAlreadyLinked]);
|
|
return {showApplicationAccountLink: property != null, applicationAccountLinkMarkAsDismissed: property2,
|
|
startApplicationAccountLinkAuthorization: value5, accountLinkApplication: connectionApp};
|
|
function _fun111046() { // fn#111046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14925:1053, offset: 0x0239183a, size: 52 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__.__proto__;
|
|
return GuildStore.getGuild(guildId)?.gameApplicationIds ?? [];
|
|
}
|
|
|
|
function _fun111047() { // fn#111047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14925:1720, offset: 0x0239186e, size: 116 bytes, params: 1, frame: 18
|
|
var value2;
|
|
var moduleValue;
|
|
var UNSAFE_markSingleUseGuildDismissibleContentAsDismissed;
|
|
var MOBILE_ACCOUNT_LINKING_BANNER;
|
|
var guildIdBinding;
|
|
if (hasAlreadyLinked) {
|
|
value2 = environment.__proto__.__proto__;
|
|
moduleValue = require(3968) /* metro dependency 3968: DismissibleContentUnsafeUtils */;
|
|
UNSAFE_markSingleUseGuildDismissibleContentAsDismissed = moduleValue.UNSAFE_markSingleUseGuildDismissibleContentAsDismissed;
|
|
MOBILE_ACCOUNT_LINKING_BANNER = (require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.MOBILE_ACCOUNT_LINKING_BANNER;
|
|
guildIdBinding = guildId;
|
|
Reflect.apply(UNSAFE_markSingleUseGuildDismissibleContentAsDismissed, moduleValue,
|
|
[MOBILE_ACCOUNT_LINKING_BANNER,
|
|
guildIdBinding, {dismissAction: ContentDismissActionType.INDIRECT_ACTION, guildId: guildIdBinding,
|
|
groupName: DismissibleContentGroupName.CHANNEL_NOTICES}]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun111048() { // fn#111048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14925:2261, offset: 0x023918e2, size: 163 bytes, params: 1, frame: 13
|
|
const SPACER = ChannelListChannelNoticeRow.SPACER;
|
|
const items2 = [SPACER];
|
|
if (result) {
|
|
items2.push(ChannelListChannelNoticeRow.GAME_CLAIM);
|
|
}
|
|
if (showApplicationAccountLink) {
|
|
items2.push(ChannelListChannelNoticeRow.APPLICATION_ACCOUNT_LINK);
|
|
}
|
|
if (env0_2) {
|
|
items2.push(ChannelListChannelNoticeRow.GUILD_PROGRESS);
|
|
} else if (env0_4) {
|
|
items2.push(ChannelListChannelNoticeRow.MFA_WARNING);
|
|
}
|
|
if (env0_5) {
|
|
items2.push(ChannelListChannelNoticeRow.LIVE_CHANNEL_NOTICE);
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun111041, 14728, [57, 31, 11933, 1935, 1867, 1878, 5101, 661, 1376, 14579, 632, 6772, 6774, 14729,
|
|
7013, 1365, 3968, 14567, 14730,
|
|
2]) /* metro module 14728, dependencies: [57, 31, 11933, 1935, 1867, 1878, 5101, 661, 1376, 14579, 632, 6772, 6774, 14729, 7013, 1365, 3968, 14567, 14730, 2] */;
|