63 lines
3.8 KiB
TypeScript
63 lines
3.8 KiB
TypeScript
/* Metro module 8063; source: modules/applications/utils/ApplicationInstallUtils.tsx; dependencies: [7861, 5066, 8042, 2] */
|
|
function _fun64013(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8241:6, offset: 0x01b993f5, size: 160 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const closure = function({customInstallUrl, installParams, integrationTypesConfig}) {
|
|
var r0;
|
|
var r1;
|
|
var value = customInstallUrl != null;
|
|
r0 = value || installParams != null;
|
|
if (!r0) {
|
|
value = integrationTypesConfig != null;
|
|
if (value) {
|
|
value = global.Object.values(integrationTypesConfig);
|
|
value = value.some(_fun64015);
|
|
r1 = value;
|
|
} else {
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const applicationCommandIndexStore = importDefault(7861) /* metro dependency 7861: ApplicationCommandIndexStore */;
|
|
const env0_3 = (require(5066) /* metro dependency 5066: ApplicationCommandConstants */).BuiltInSectionId;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/applications/utils/ApplicationInstallUtils.tsx');
|
|
exports.canInstallApplication = closure;
|
|
exports.isAppUserInstallable = isAppUserInstallable;
|
|
exports.shouldInstallApplicationOnDemand = shouldInstallApplicationOnDemand;
|
|
}
|
|
|
|
function canInstallApplication({customInstallUrl, installParams, integrationTypesConfig}) { // fn#64014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8241:133, offset: 0x01b99495, size: 85 bytes, params: 2, frame: 13
|
|
var r1;
|
|
let value = customInstallUrl != null;
|
|
let r0 = value || installParams != null;
|
|
if (!r0) {
|
|
value = integrationTypesConfig != null;
|
|
if (value) {
|
|
value = global.Object.values(integrationTypesConfig);
|
|
value = value.some(function(a0) {
|
|
var value = undefined;
|
|
return (a0 == null ? value : a0.oauth2_install_params) != null || (a0 == null ? value : a0.oauth2InstallParams) != null;
|
|
});
|
|
r1 = value;
|
|
} else {
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function isAppUserInstallable({customInstallUrl, installParams, integrationTypesConfig}) { // fn#64016, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8241:539, offset: 0x01b9951a, size: 102 bytes, params: 2, frame: 14
|
|
return canInstallApplication({customInstallUrl: customInstallUrl, installParams: installParams,
|
|
integrationTypesConfig: integrationTypesConfig}) && integrationTypesConfig != null && (require(8042) /* metro dependency 8042: ApplicationIntegrationType */).ApplicationIntegrationType.USER_INSTALL in integrationTypesConfig;
|
|
}
|
|
|
|
function shouldInstallApplicationOnDemand({applicationId, channel, commandIntegrationTypes}) { // fn#64017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8241:823, offset: 0x01b99580, size: 188 bytes, params: 2, frame: 17
|
|
return !(commandIntegrationTypes != null && !commandIntegrationTypes.includes((require(8042) /* metro dependency 8042: ApplicationIntegrationType */).ApplicationIntegrationType.USER_INSTALL)) && (!(applicationId === BuiltInSectionId.BUILT_IN) && (!ApplicationCommandIndexStore.hasUserStateApplication(applicationId) && (channel == null || !ApplicationCommandIndexStore.hasContextStateApplication({applicationId: applicationId,
|
|
channelId: channel.id, guildId: channel.guild_id}))));
|
|
}
|
|
|