decord/source/modules/search/native/hooks/useAutoSearchMembersTab.tsx

57 lines
2.3 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 15460
// Function ID: 118795
2026-07-20 16:05:17 +00:00
// Name: useAutoSearchMembersTab
2026-07-24 07:16:23 +00:00
// Dependencies: [31, 10109, 11427, 653, 22, 10110, 11434, 11426, 2]
2026-07-20 16:05:17 +00:00
// Exports: useAutoSearchMembersTab
2026-07-24 07:16:23 +00:00
// Module 15460 (useAutoSearchMembersTab)
2026-07-23 10:11:24 +00:00
import result from "result";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { SEARCH_TEXT_INPUT_DEBOUNCE_TIME as closure_5 } from "SEARCH_TEXT_INPUT_DEBOUNCE_TIME";
import { SearchTypes } from "ME";
const require = arg1;
let result = require("SEARCH_TEXT_INPUT_DEBOUNCE_TIME").fileFinishedImporting("modules/search/native/hooks/useAutoSearchMembersTab.tsx");
2026-07-20 16:05:17 +00:00
export const useAutoSearchMembersTab = function useAutoSearchMembersTab(searchContext, arg1) {
2026-07-23 10:11:24 +00:00
let closure_0 = searchContext;
let closure_1 = arg1;
2026-07-20 16:05:17 +00:00
const items = [arg1, searchContext];
const effect = React.useEffect(() => {
2026-07-23 10:11:24 +00:00
if (!callback) {
let obj = searchContext(outer1_2[4]);
const debounceResult = searchContext(outer1_2[4]).debounce((searchQueryString) => {
if (!outer2_4.isAutocompleteVisible(outer1_0)) {
let obj = callback(outer2_2[5]);
const guildIdFromSearchContext = obj.getGuildIdFromSearchContext(outer1_0);
2026-07-20 16:05:17 +00:00
if (null != guildIdFromSearchContext) {
2026-07-23 10:11:24 +00:00
const channelIds = outer2_4.getChannelIds(outer1_0);
2026-07-20 16:05:17 +00:00
let tmp8 = null;
if (0 !== channelIds.size) {
let first = null;
if (1 === channelIds.size) {
const _Array = Array;
first = Array.from(channelIds)[0];
}
tmp8 = first;
}
2026-07-23 10:11:24 +00:00
obj = { searchContext: outer1_0, searchQueryString, guildId: guildIdFromSearchContext, channelId: tmp8 };
2026-07-20 16:05:17 +00:00
let tmp13 = null;
2026-07-23 10:11:24 +00:00
if (outer1_0.type === outer2_6.THREAD) {
2026-07-20 16:05:17 +00:00
tmp13 = tmp8;
}
obj.threadId = tmp13;
2026-07-23 10:11:24 +00:00
callback2(outer2_2[6]).searchGuildMemberTab(obj);
const obj2 = callback2(outer2_2[6]);
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
}, outer1_5);
return callback(outer1_2[7]).subscribeTextInputValue(searchContext, debounceResult);
2026-07-20 16:05:17 +00:00
}
}, items);
const items1 = [searchContext];
const effect1 = React.useEffect(() => () => {
2026-07-23 10:11:24 +00:00
const result = callback(outer2_2[6]).cleanupGuildMemberTab(outer1_0);
2026-07-20 16:05:17 +00:00
}, items1);
};