mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-28 21:26:13 +01:00
fix(PluginAuthForm): handle case when pluginKey is null or undefined fix(PluginStoreDialog): handle case when getAvailablePluginFromKey is null or undefined fix(AuthContext): make authConfig optional in AuthContextProvider feat(hooks): add useServerStream hook fix(conversation): setSubmission to null instead of empty object fix(preset): specify type for presets atom fix(search): specify type for isSearchEnabled atom fix(submission): specify type for submission atom
41 lines
829 B
TypeScript
41 lines
829 B
TypeScript
import { TMessage } from 'librechat-data-provider';
|
|
import { atom, selector } from 'recoil';
|
|
import { buildTree } from '~/utils';
|
|
|
|
const isSearchEnabled = atom<boolean | null>({
|
|
key: 'isSearchEnabled',
|
|
default: null,
|
|
});
|
|
|
|
const searchQuery = atom({
|
|
key: 'searchQuery',
|
|
default: '',
|
|
});
|
|
|
|
const searchResultMessages = atom<TMessage[] | null>({
|
|
key: 'searchResultMessages',
|
|
default: null,
|
|
});
|
|
|
|
const searchResultMessagesTree = selector({
|
|
key: 'searchResultMessagesTree',
|
|
get: ({ get }) => {
|
|
return buildTree(get(searchResultMessages), true);
|
|
},
|
|
});
|
|
|
|
const isSearching = selector({
|
|
key: 'isSearching',
|
|
get: ({ get }) => {
|
|
const data = get(searchQuery);
|
|
return !!data;
|
|
},
|
|
});
|
|
|
|
export default {
|
|
isSearchEnabled,
|
|
isSearching,
|
|
searchResultMessages,
|
|
searchResultMessagesTree,
|
|
searchQuery,
|
|
};
|