File size: 575 Bytes
f0743f4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | import { useSetRecoilState } from 'recoil';
import useUpdateTagsInConvo from './useUpdateTagsInConvo';
import store from '~/store';
const useBookmarkSuccess = (conversationId: string) => {
const updateConversation = useSetRecoilState(store.updateConversationSelector(conversationId));
const { updateTagsInConversation } = useUpdateTagsInConvo();
return (newTags: string[]) => {
if (!conversationId) {
return;
}
updateTagsInConversation(conversationId, newTags);
updateConversation({ tags: newTags });
};
};
export default useBookmarkSuccess;
|