101 lines
5.0 KiB
TypeScript
101 lines
5.0 KiB
TypeScript
/* Metro module 11682; source: modules/app_launcher/hooks/useIsPrimaryEntryPointDisabled.tsx; dependencies: [4235, 3784, 482, 566, 9467, 11598, 8448, 8049, 477, 1244, 2] */
|
|
function _fun89536(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11868:6, offset: 0x02012746, size: 156 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const applicationRecord = importDefault(4235) /* metro dependency 4235: ApplicationRecord */;
|
|
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
|
const env0_5 = (require(482) /* metro dependency 482: Constants */).Permissions;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_launcher/hooks/useIsPrimaryEntryPointDisabled.tsx');
|
|
exports.default = useIsPrimaryEntryPointDisabled;
|
|
}
|
|
|
|
function useIsPrimaryEntryPointDisabled({context, application, activityAction}) { // fn#89537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11868:244, offset: 0x020127e2, size: 786 bytes, params: 2, frame: 24
|
|
var r5;
|
|
var r7;
|
|
var r1;
|
|
var r2;
|
|
var moduleValue3;
|
|
var moduleValue4;
|
|
var defaultImport;
|
|
var moduleValue5;
|
|
var supported_platforms;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var value13;
|
|
var value14;
|
|
const value = undefined;
|
|
const channel = context.type !== 'channel' ? value : context.channel;
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], function() {
|
|
var USE_EMBEDDED_ACTIVITIES = Permissions.USE_EMBEDDED_ACTIVITIES;
|
|
return PermissionStore.can(USE_EMBEDDED_ACTIVITIES, channel);
|
|
});
|
|
const value4 = (require(9467) /* metro dependency 9467: getEmbeddedActivityLaunchability */).useEmbeddedActivityLaunchability(channel == null ? value : channel.id);
|
|
const ActivityAction = (require(11598) /* metro dependency 11598: useActivityShelfItem */).ActivityAction;
|
|
let LEAVE = ActivityAction.LEAVE;
|
|
if (LEAVE === activityAction) {
|
|
r5 = false;
|
|
} else if (ActivityAction.START === activityAction) {
|
|
if (channel == null) {
|
|
r5 = false;
|
|
} else if (channel == null) {
|
|
moduleValue4 = require(8448) /* metro dependency 8448: ActivitiesInTextUtils */;
|
|
r5 = !moduleValue4.isActivitiesInTextEnabled(channel) && true;
|
|
} else if (channel.isGuildVoice()) {
|
|
r5 = !(value4 === (require(9467) /* metro dependency 9467: getEmbeddedActivityLaunchability */).EmbeddedActivityLaunchability.CAN_LAUNCH) && true;
|
|
} else {
|
|
moduleValue4 = require(8448) /* metro dependency 8448: ActivitiesInTextUtils */;
|
|
r5 = !moduleValue4.isActivitiesInTextEnabled(channel) && true;
|
|
}
|
|
} else if (ActivityAction.JOIN !== activityAction) {
|
|
r5 = false;
|
|
} else if (channel == null) {
|
|
moduleValue3 = require(8448) /* metro dependency 8448: ActivitiesInTextUtils */;
|
|
r5 = !moduleValue3.isActivitiesInTextEnabled(channel) && true;
|
|
} else if (channel.isGuildVoice()) {
|
|
r5 = !value3;
|
|
} else {
|
|
moduleValue3 = require(8448) /* metro dependency 8448: ActivitiesInTextUtils */;
|
|
r5 = !moduleValue3.isActivitiesInTextEnabled(channel) && true;
|
|
}
|
|
LEAVE = ActivityAction.LEAVE;
|
|
if (activityAction === LEAVE) {
|
|
r1 = value;
|
|
r2 = r5;
|
|
} else {
|
|
r7 = application instanceof ApplicationRecord ? application.embeddedActivityConfig : application.embedded_activity_config;
|
|
defaultImport = importDefault(8049) /* metro dependency 8049: getPlatform */;
|
|
moduleValue5 = require(477) /* metro dependency 477: PlatformUtils */;
|
|
if (r7 == null) {
|
|
if (channel != null && channel.isThread()) {
|
|
value13 = intl.string(t.ddSR3v);
|
|
value14 = true;
|
|
r1 = value13;
|
|
r2 = value14;
|
|
} else {
|
|
r1 = value;
|
|
r2 = r5;
|
|
}
|
|
} else {
|
|
supported_platforms = r7.supported_platforms;
|
|
if (supported_platforms.includes(defaultImport(moduleValue5.getOS()))) {
|
|
if (channel != null && channel.isThread()) {
|
|
value13 = intl.string(t.ddSR3v);
|
|
value14 = true;
|
|
r1 = value13;
|
|
r2 = value14;
|
|
} else {
|
|
r1 = value;
|
|
r2 = r5;
|
|
}
|
|
} else {
|
|
r1 = intl.string(t.z2YTgJ);
|
|
r2 = false;
|
|
}
|
|
}
|
|
}
|
|
r1 = r2 && r1 == null ? intl.string(t.f41E1g) : r1;
|
|
return {disabled: r2, reason: r1};
|
|
}
|
|
|