68 lines
3.3 KiB
TypeScript
68 lines
3.3 KiB
TypeScript
/* Metro module 11817; source: modules/guild_sidebar/useShowConnectedUserLimit.tsx; dependencies: [661, 9234, 2] */
|
|
function _fun90525(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12003:6, offset: 0x0203cde3, size: 161 bytes, params: 8, frame: 19
|
|
const formatNumber = function(a0) {
|
|
var r2;
|
|
var r0;
|
|
var value2;
|
|
var value = a1;
|
|
r2 = value !== undefined ? value : 1000;
|
|
if (a0 >= r2) {
|
|
value = global.Math.floor(a0 / r2);
|
|
value2 = '';
|
|
value = value2 + value + 'k' + (a0 % r2 == 0 ? value2 : '+');
|
|
r0 = value;
|
|
} else {
|
|
value = a0.toFixed(0);
|
|
value = value.padStart(2, '0');
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
};
|
|
const closure = useConnectedUserLimit;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = (require(661) /* metro dependency 661: Constants */).MAX_STAGE_VOICE_USER_LIMIT;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_sidebar/useShowConnectedUserLimit.tsx');
|
|
exports.default = useShowConnectedUserLimit;
|
|
exports.useConnectedUserLimit = closure;
|
|
exports.useConnectedUserLimitFormatted = useConnectedUserLimitFormatted;
|
|
}
|
|
|
|
function useConnectedUserLimit({channel, video, considerMaxStageVoiceUserLimit}) { // fn#90527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12003:243, offset: 0x0203cf04, size: 150 bytes, params: 2, frame: 18
|
|
considerMaxStageVoiceUserLimit = considerMaxStageVoiceUserLimit === undefined || considerMaxStageVoiceUserLimit;
|
|
const limit = (importDefault(9234) /* metro dependency 9234: useChannelVideoLimit */)(channel).limit;
|
|
let userLimit = channel.userLimit;
|
|
userLimit = userLimit > 0 ? channel.userLimit : -1;
|
|
const r1 = video && limit > 0 ? userLimit > 0 ? global.Math.min(userLimit, limit) : limit : userLimit;
|
|
return considerMaxStageVoiceUserLimit && r1 === MAX_STAGE_VOICE_USER_LIMIT ? 0 : r1;
|
|
}
|
|
|
|
function useShowConnectedUserLimit({channel, locked, video, selected}) { // fn#90528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12003:537, offset: 0x0203cf9a, size: 71 bytes, params: 2, frame: 14
|
|
let value = useConnectedUserLimit({channel: channel, video: video});
|
|
value = value > 0;
|
|
return value && !locked && !selected;
|
|
}
|
|
|
|
function useConnectedUserLimitFormatted({channel, video, userCount}) { // fn#90529, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12003:753, offset: 0x0203cfe1, size: 120 bytes, params: 2, frame: 17
|
|
var r1;
|
|
var r0;
|
|
var formatNumberBinding;
|
|
var value;
|
|
const value2 = useConnectedUserLimit({channel: channel, video: video});
|
|
if (value2 <= 0) {
|
|
r0 = null;
|
|
} else {
|
|
if (userCount != null) {
|
|
formatNumberBinding = formatNumber;
|
|
value = formatNumberBinding(userCount);
|
|
value = '' + value + '/' + formatNumberBinding(value2);
|
|
r1 = value;
|
|
} else {
|
|
r1 = formatNumber(value2);
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|