119 lines
6.0 KiB
TypeScript
119 lines
6.0 KiB
TypeScript
/* Metro module 11541; source: modules/channel_text_area/ChatInputContentCallbacks.tsx; dependencies: [57, 31, 6875, 6903, 6890, 7875, 22, 2] */
|
|
import Module00022 from '../../by-id/module-00022.js'; /* Metro dependency 22 */
|
|
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import ChannelMemberStore from '../../stores/ChannelMemberStore.tsx'; /* Metro dependency 6875 */
|
|
import UseMessageMaxLength from '../messages/useMessageMaxLength.tsx'; /* Metro dependency 7875 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
|
|
function _fun88436(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11727:6, offset: 0x01fe2fac, size: 193 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const areMemberGroupsHydrated = function(a0) {
|
|
var r1;
|
|
var r0;
|
|
var value = a0.length > 1;
|
|
if (value) {
|
|
r0 = value;
|
|
} else {
|
|
value = a0.length === 1;
|
|
r1 = value && a0[0].type === 'GROUP';
|
|
r1 = r1 && a0[0].id === 'unknown';
|
|
value = !r1;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
};
|
|
const tryUpdateSubscriptionForHereMention2 = tryUpdateSubscriptionForHereMention;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/channel_text_area/ChatInputContentCallbacks.tsx');
|
|
exports.tryUpdateSubscriptionForHereMention = tryUpdateSubscriptionForHereMention2;
|
|
exports.useHereMentionCallback = useHereMentionCallback;
|
|
function tryUpdateSubscriptionForHereMention(a0, a1, a2, a3) { // fn#88438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11727:249, offset: 0x01fe30b9, size: 176 bytes, params: 5, frame: 21
|
|
var r2;
|
|
var r1;
|
|
var r0;
|
|
var value8;
|
|
var value;
|
|
const areMemberGroupsHydratedBinding = areMemberGroupsHydrated;
|
|
const channelMemberStoreBinding = ChannelMemberStore;
|
|
const getProps = channelMemberStoreBinding.getProps;
|
|
const value2 = areMemberGroupsHydratedBinding(Reflect.apply(getProps, channelMemberStoreBinding, [a2, a3]).groups);
|
|
if (value2) {
|
|
r0 = !!value2;
|
|
} else {
|
|
r2 = a0.length < 5 || a0.length > a1;
|
|
if (r2) {
|
|
r1 = !r2;
|
|
} else {
|
|
value8 = a0.indexOf(env0_6) !== -1;
|
|
if (value8) {
|
|
value = require(6903) /* metro dependency 6903: GuildSubscriptionsActionCreators */;
|
|
value.subscribeChannel(a2, a3,
|
|
(require(6890) /* metro dependency 6890: GuildChannelSubscriptions */).DEFAULT_RANGES);
|
|
value = true;
|
|
r2 = value;
|
|
} else {
|
|
r2 = value8;
|
|
}
|
|
r1 = r2;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function useHereMentionCallback(a0, a1, a2) { // fn#88439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11727:654, offset: 0x01fe3169, size: 188 bytes, params: 4, frame: 19
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
const value2 = (UseMessageMaxLength)();
|
|
const env0_3 = value2;
|
|
const value = env0_3(ReactModule.useState(false), 2);
|
|
const property = value[0];
|
|
const env0_5 = value[1];
|
|
ReactModule.useEffect(_fun88442, [property, ReactModule.useMemo(_fun88440, [value2, a1, a2]), a0, a1, a2]);
|
|
function _fun88440() { // fn#88440, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11727:762, offset: 0x01fe3225, size: 65 bytes, params: 1, frame: 15
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
return (Module00022).debounce(_fun88441, 200, {maxWait: 500});
|
|
function _fun88441(a0) { // fn#88441, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11727:784, offset: 0x01fe3266, size: 49 bytes, params: 2, frame: 18
|
|
if (tryUpdateSubscriptionForHereMention(a0, env1_3, require, importDefault)) {
|
|
env1_5(true);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun88442() { // fn#88442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11727:884, offset: 0x01fe3297, size: 104 bytes, params: 1, frame: 15
|
|
const channelMemberStoreBinding = ChannelMemberStore;
|
|
const getProps = channelMemberStoreBinding.getProps;
|
|
const groups = Reflect.apply(getProps, channelMemberStoreBinding, [require, importDefault]).groups;
|
|
if (require == null) {
|
|
return undefined;
|
|
}
|
|
if (areMemberGroupsHydrated(groups)) {
|
|
return undefined;
|
|
}
|
|
if (ReactModule) {
|
|
return undefined;
|
|
}
|
|
env0_0.addListener('text-changed', env0_6);
|
|
return _fun88443;
|
|
function _fun88443() { // fn#88443, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11727:1001, offset: 0x01fe32ff, size: 43 bytes, params: 1, frame: 13
|
|
const binding = env1_0;
|
|
const removeListener = binding.removeListener;
|
|
const binding2 = env1_6;
|
|
Reflect.apply(removeListener, binding, ['text-changed', binding2]);
|
|
binding2.cancel();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun88436, 11541, [57, 31, 6875, 6903, 6890, 7875, 22,
|
|
2]) /* metro module 11541, dependencies: [57, 31, 6875, 6903, 6890, 7875, 22, 2] */;
|