mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-16 23:48:09 +01:00
28 lines
567 B
JavaScript
28 lines
567 B
JavaScript
|
|
import React from "react";
|
||
|
|
import {
|
||
|
|
RecoilRoot,
|
||
|
|
atom,
|
||
|
|
selector,
|
||
|
|
useRecoilState,
|
||
|
|
useRecoilValue,
|
||
|
|
useSetRecoilState,
|
||
|
|
} from "recoil";
|
||
|
|
|
||
|
|
const refreshConversationsHint = atom({
|
||
|
|
key: "refreshConversationsHint",
|
||
|
|
default: 1,
|
||
|
|
});
|
||
|
|
|
||
|
|
const useConversations = () => {
|
||
|
|
const setRefreshConversationsHint = useSetRecoilState(
|
||
|
|
refreshConversationsHint
|
||
|
|
);
|
||
|
|
|
||
|
|
const refreshConversations = () =>
|
||
|
|
setRefreshConversationsHint((prevState) => prevState + 1);
|
||
|
|
|
||
|
|
return { refreshConversations };
|
||
|
|
};
|
||
|
|
|
||
|
|
export default { refreshConversationsHint, useConversations };
|