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

59 lines
2.3 KiB
TypeScript
Raw Normal View History

// Module ID: 16833
// Function ID: 16834
2026-07-20 16:05:17 +00:00
// Name: useAutoSearchMembersTab
// Dependencies: [19, 12468, 12482, 1074, 12, 12469, 12490, 12467, 2]
2026-07-20 16:05:17 +00:00
// Exports: useAutoSearchMembersTab
// Module 16833 (useAutoSearchMembersTab)
import _mod12 from "module_12" /* 12 */;
import SearchPlatformUtilsDefault from "SearchPlatformUtils" /* 12467 */;
import noop from "module_19" /* 19 */;
import SearchQueryStore from "SearchQueryStore" /* 12468 */;
2026-07-23 10:11:24 +00:00
require = fn;
let closure_5 = fn(12482).SEARCH_TEXT_INPUT_DEBOUNCE_TIME;
const SearchTypes = fn(1074).SearchTypes;
const size = fn(2);
let result = size.fileFinishedImporting("modules/search/native/hooks/useAutoSearchMembersTab.tsx");
2026-07-20 16:05:17 +00:00
export const useAutoSearchMembersTab = function useAutoSearchMembersTab(searchContext, arg1) {
2026-08-24 06:08:38 +00:00
closure_0 = searchContext;
closure_1 = arg1;
2026-07-20 16:05:17 +00:00
const items = [arg1, searchContext];
const effect = noop.useEffect(() => {
if (!closure_1) {
const debounceResult = _mod12.debounce((searchQueryString) => {
if (!autocompleteVisible.isAutocompleteVisible(searchContext)) {
const guildIdFromSearchContext = closure_0(12469).getGuildIdFromSearchContext(tmp);
2026-07-20 16:05:17 +00:00
if (null != guildIdFromSearchContext) {
const channelIds = autocompleteVisible.getChannelIds(tmp);
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;
}
const obj4 = { searchContext: tmp, searchQueryString, guildId: guildIdFromSearchContext, channelId: tmp8, threadId: null };
2026-07-29 08:29:29 +00:00
let tmp12 = null;
if (tmp.type === constants.THREAD) {
2026-07-29 08:29:29 +00:00
tmp12 = tmp8;
2026-07-20 16:05:17 +00:00
}
obj4.threadId = tmp12;
closure_1(12490).searchGuildMemberTab(obj4);
const obj3 = closure_1(12490);
2026-07-20 16:05:17 +00:00
}
const obj2 = closure_0(12469);
2026-07-20 16:05:17 +00:00
}
}, closure_5);
return SearchPlatformUtilsDefault.subscribeTextInputValue(closure_0, debounceResult);
2026-07-20 16:05:17 +00:00
}
}, items);
const items1 = [searchContext];
const effect1 = noop.useEffect(() => () => {
const result = closure_1(12490).cleanupGuildMemberTab(searchContext);
2026-07-20 16:05:17 +00:00
}, items1);
};