mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
✨ feat: implement search parameter updates (#7151)
* feat: implement search parameter updates * Update url params when values change reset params on new chat move logic to families.ts revert unchanged files --------- Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
parent
f7777a2723
commit
4af72aac9b
5 changed files with 481 additions and 4 deletions
|
|
@ -95,7 +95,7 @@ export default function useQueryParams({
|
|||
const settingsTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
const methods = useChatFormContext();
|
||||
const [searchParams] = useSearchParams();
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
const getDefaultConversation = useDefaultConvo();
|
||||
const modularChat = useRecoilValue(store.modularChat);
|
||||
const availableTools = useRecoilValue(store.availableTools);
|
||||
|
|
@ -332,6 +332,12 @@ export default function useQueryParams({
|
|||
|
||||
/** Mark processing as complete and clean up as needed */
|
||||
const success = () => {
|
||||
const currentParams = new URLSearchParams(searchParams.toString());
|
||||
currentParams.delete('prompt');
|
||||
currentParams.delete('q');
|
||||
currentParams.delete('submit');
|
||||
|
||||
setSearchParams(currentParams, { replace: true });
|
||||
processedRef.current = true;
|
||||
console.log('Parameters processed successfully');
|
||||
clearInterval(intervalId);
|
||||
|
|
@ -407,6 +413,7 @@ export default function useQueryParams({
|
|||
newQueryConvo,
|
||||
newConversation,
|
||||
submitMessage,
|
||||
setSearchParams,
|
||||
queryClient,
|
||||
processSubmission,
|
||||
]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue