80 lines
4.9 KiB
TypeScript
80 lines
4.9 KiB
TypeScript
/* Metro module 9672; source: modules/search/native/hooks/useSearchContext.tsx; dependencies: [31, 1379, 661, 44, 632, 2] */
|
|
import ChannelStore from '../../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
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 */
|
|
import * as UseStateFromStoresModule from '../../../../external/discord_common/js/packages/flux/useStateFromStores.tsx'; /* Metro dependency 632 */
|
|
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun75783(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#75783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9858:6, offset: 0x01db9aaa, size: 204 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const getChannelDetailsSearchContext2 = getChannelDetailsSearchContext;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/search/native/hooks/useSearchContext.tsx');
|
|
exports.useGuildSearchContext = useGuildSearchContext;
|
|
exports.useGuildChannelSearchContext = useGuildChannelSearchContext;
|
|
exports.getChannelDetailsSearchContext = getChannelDetailsSearchContext2;
|
|
exports.useChannelDetailsSearchContext = useChannelDetailsSearchContext;
|
|
function getChannelDetailsSearchContext(a0, a1, a2) { // fn#75784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9858:138, offset: 0x01db9b76, size: 147 bytes, params: 4, frame: 17
|
|
var r0;
|
|
if (a2) {
|
|
(importDefault(44) /* metro dependency 44 */)(a1 != null,
|
|
'[useChannelDetailsSearchContext] Thread must have a guild id');
|
|
r0 = {type: SearchTypes.THREAD, guildId: a1, channelId: a0};
|
|
} else {
|
|
r0 = a1 == null ? {type: SearchTypes.CHANNEL, channelId: a0} : {type: SearchTypes.GUILD_CHANNEL, guildId: a1,
|
|
channelId: a0};
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function useGuildSearchContext(a0) { // fn#75785, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9858:502, offset: 0x01db9c09, size: 44 bytes, params: 2, frame: 14
|
|
const env0_0 = a0;
|
|
return ReactModule.useMemo(_fun75786, [a0]);
|
|
function _fun75786() { // fn#75786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9858:554, offset: 0x01db9c35, size: 32 bytes, params: 1, frame: 2
|
|
const GUILD = SearchTypes.GUILD;
|
|
return {type: GUILD, guildId: env0_0};
|
|
}
|
|
|
|
}
|
|
|
|
function useGuildChannelSearchContext(a0, a1) { // fn#75787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9858:623, offset: 0x01db9c55, size: 55 bytes, params: 3, frame: 15
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
return ReactModule.useMemo(_fun75788, [a0, a1]);
|
|
function _fun75788() { // fn#75788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9858:684, offset: 0x01db9c8c, size: 40 bytes, params: 1, frame: 3
|
|
const GUILD_CHANNEL = SearchTypes.GUILD_CHANNEL;
|
|
return {type: GUILD_CHANNEL, guildId: env0_0, channelId: require};
|
|
}
|
|
|
|
}
|
|
|
|
function useChannelDetailsSearchContext(a0, a1) { // fn#75789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9858:841, offset: 0x01db9cb4, size: 115 bytes, params: 3, frame: 17
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
return ReactModule.useMemo(_fun75791, [a0, a1,
|
|
(UseStateFromStoresModule).useStateFromStores([ChannelStore], _fun75790)]);
|
|
function _fun75790() { // fn#75790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9858:924, offset: 0x01db9d27, size: 57 bytes, params: 1, frame: 12
|
|
var r1;
|
|
let value = environment.__proto__;
|
|
value = ChannelStore.getChannel(env0_0);
|
|
if (value == null) {
|
|
r1 = undefined;
|
|
} else {
|
|
value = value.isThread();
|
|
r1 = value;
|
|
}
|
|
return r1 != null && r1;
|
|
}
|
|
|
|
function _fun75791() { // fn#75791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9858:1024, offset: 0x01db9d60, size: 33 bytes, params: 1, frame: 15
|
|
return getChannelDetailsSearchContext(env0_0, require, env0_2);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun75783, 9672, [31, 1379, 661, 44, 632,
|
|
2]) /* metro module 9672, dependencies: [31, 1379, 661, 44, 632, 2] */;
|