Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
58 lines
2.3 KiB
TypeScript
58 lines
2.3 KiB
TypeScript
// Module ID: 16818
|
|
// Function ID: 16819
|
|
// Name: useAutoSearchMembersTab
|
|
// Dependencies: [19, 12409, 12423, 1074, 12, 12410, 12431, 12408, 2]
|
|
// Exports: useAutoSearchMembersTab
|
|
|
|
// Module 16818 (useAutoSearchMembersTab)
|
|
import _mod12 from "module_12" /* 12 */;
|
|
import SearchPlatformUtilsDefault from "SearchPlatformUtils" /* 12408 */;
|
|
import noop from "module_19" /* 19 */;
|
|
import SearchQueryStore from "SearchQueryStore" /* 12409 */;
|
|
|
|
require = fn;
|
|
let closure_5 = fn(12423).SEARCH_TEXT_INPUT_DEBOUNCE_TIME;
|
|
const SearchTypes = fn(1074).SearchTypes;
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/search/native/hooks/useAutoSearchMembersTab.tsx");
|
|
|
|
export const useAutoSearchMembersTab = function useAutoSearchMembersTab(searchContext, arg1) {
|
|
closure_0 = searchContext;
|
|
closure_1 = arg1;
|
|
const items = [arg1, searchContext];
|
|
const effect = noop.useEffect(() => {
|
|
if (!closure_1) {
|
|
const debounceResult = _mod12.debounce((searchQueryString) => {
|
|
if (!autocompleteVisible.isAutocompleteVisible(searchContext)) {
|
|
const guildIdFromSearchContext = closure_0(12410).getGuildIdFromSearchContext(tmp);
|
|
if (null != guildIdFromSearchContext) {
|
|
const channelIds = autocompleteVisible.getChannelIds(tmp);
|
|
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 };
|
|
let tmp12 = null;
|
|
if (tmp.type === constants.THREAD) {
|
|
tmp12 = tmp8;
|
|
}
|
|
obj4.threadId = tmp12;
|
|
closure_1(12431).searchGuildMemberTab(obj4);
|
|
const obj3 = closure_1(12431);
|
|
}
|
|
const obj2 = closure_0(12410);
|
|
}
|
|
}, closure_5);
|
|
return SearchPlatformUtilsDefault.subscribeTextInputValue(closure_0, debounceResult);
|
|
}
|
|
}, items);
|
|
const items1 = [searchContext];
|
|
const effect1 = noop.useEffect(() => () => {
|
|
const result = closure_1(12431).cleanupGuildMemberTab(searchContext);
|
|
}, items1);
|
|
};
|