Files
2026-07-28 01:06:53 +03:00

72 lines
3.8 KiB
TypeScript

/* Metro module 11817; source: modules/guild_sidebar/useShowConnectedUserLimit.tsx; dependencies: [661, 9234, 2] */
import UseChannelVideoLimit from '../video_calls/useChannelVideoLimit.tsx'; /* Metro dependency 9234 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
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_90526 = 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 useConnectedUserLimit2 = useConnectedUserLimit;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/guild_sidebar/useShowConnectedUserLimit.tsx');
exports.default = useShowConnectedUserLimit;
exports.useConnectedUserLimit = useConnectedUserLimit2;
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 = (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 formatNumber_90526Binding;
var value;
const value2 = useConnectedUserLimit({channel: channel, video: video});
if (value2 <= 0) {
r0 = null;
} else {
if (userCount != null) {
formatNumber_90526Binding = formatNumber_90526;
value = formatNumber_90526Binding(userCount);
value = '' + value + '/' + formatNumber_90526Binding(value2);
r1 = value;
} else {
r1 = formatNumber_90526(value2);
}
r0 = r1;
}
return r0;
}
}
global.__d(_fun90525, 11817, [661, 9234, 2]) /* metro module 11817, dependencies: [661, 9234, 2] */;