mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-19 08:46:11 +01:00
clear all convos in progress, async code refactored in debugging warning
This commit is contained in:
parent
053368646d
commit
511ac948b4
10 changed files with 84 additions and 65 deletions
|
|
@ -11,8 +11,11 @@ const postRequest = async (url, { arg }) => {
|
|||
export const swr = (path) => useSWR(path, fetcher);
|
||||
|
||||
export default function manualSWR(path, type, successCallback) {
|
||||
const options = {};
|
||||
|
||||
if (successCallback) {
|
||||
options.onSuccess = successCallback;
|
||||
}
|
||||
const fetchFunction = type === 'get' ? fetcher : postRequest;
|
||||
return useSWRMutation(path, fetchFunction, {
|
||||
onSuccess: successCallback
|
||||
});
|
||||
return useSWRMutation(path, fetchFunction, options);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue