57 lines
3.5 KiB
TypeScript
57 lines
3.5 KiB
TypeScript
/* Metro module 10261; source: modules/activities/utils/isActivityJoinableOnCurrentPlatform.tsx; dependencies: [661, 478, 1581, 6886, 2] */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as PlatformUtilsModule from '../../../external/discord_common/js/shared/utils/PlatformUtils.tsx'; /* Metro dependency 478 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun79665(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10447:6, offset: 0x01e5d908, size: 180 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const getCurrentActivityGamePlatform2 = getCurrentActivityGamePlatform;
|
|
const isActivityJoinable2 = isActivityJoinable;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/activities/utils/isActivityJoinableOnCurrentPlatform.tsx');
|
|
exports.default = isActivityJoinableOnCurrentPlatform;
|
|
exports.getCurrentActivityGamePlatform = getCurrentActivityGamePlatform2;
|
|
exports.isActivityJoinable = isActivityJoinable2;
|
|
function getCurrentActivityGamePlatform() { // fn#79666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10447:168, offset: 0x01e5d9bc, size: 145 bytes, params: 1, frame: 14
|
|
var r0;
|
|
var moduleValue2;
|
|
if (PlatformUtilsModule.isIOS()) {
|
|
r0 = ActivityGamePlatforms.IOS;
|
|
} else {
|
|
moduleValue2 = require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */;
|
|
r0 = moduleValue2.isMetaQuest() ? ActivityGamePlatforms.META_QUEST : PlatformUtilsModule.isAndroid() ? ActivityGamePlatforms.ANDROID : ActivityGamePlatforms.DESKTOP;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function isActivityJoinable(a0) { // fn#79667, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10447:314, offset: 0x01e5da4d, size: 86 bytes, params: 2, frame: 15
|
|
let r0 = a0 == null || !(importDefault(6886) /* metro dependency 6886: hasFlag */)(a0, ActivityFlags.JOIN);
|
|
r0 = !r0 ? a0.type !== ActivityTypes.PLAYING : r0;
|
|
return !r0;
|
|
}
|
|
|
|
function isActivityJoinableOnCurrentPlatform(a0) { // fn#79668, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10447:510, offset: 0x01e5daa3, size: 127 bytes, params: 2, frame: 15
|
|
var supported_platforms;
|
|
var r0;
|
|
var currentActivityGamePlatform;
|
|
const isActivityJoinableBinding = isActivityJoinable;
|
|
const value2 = undefined;
|
|
if (isActivityJoinableBinding(a0)) {
|
|
currentActivityGamePlatform = getCurrentActivityGamePlatform();
|
|
if (((a0 == null ? value2 : a0.platform) != null ? a0.platform : ActivityGamePlatforms.DESKTOP) === currentActivityGamePlatform) {
|
|
return true;
|
|
}
|
|
supported_platforms = a0 == null ? value2 : a0.supported_platforms;
|
|
r0 = supported_platforms != null && supported_platforms.length !== 0;
|
|
r0 = r0 && supported_platforms.includes(currentActivityGamePlatform);
|
|
return r0;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun79665, 10261, [661, 478, 1581, 6886,
|
|
2]) /* metro module 10261, dependencies: [661, 478, 1581, 6886, 2] */;
|