feat: support user-provided token to bingAI and chatgptBrowser

This commit is contained in:
Wentao Lyu 2023-04-10 00:41:34 +08:00
parent a953fc9f2b
commit bbf2f8a6ca
22 changed files with 309 additions and 86 deletions

View file

@ -1,4 +1,4 @@
import { useEffect, useState } from 'react';
import React, { useEffect, useState } from 'react';
import { useRecoilValue } from 'recoil';
import DialogTemplate from '../ui/DialogTemplate';
import { Dialog } from '../ui/Dialog.tsx';
@ -11,7 +11,7 @@ import store from '~/store';
const SaveAsPresetDialog = ({ open, onOpenChange, preset }) => {
const [title, setTitle] = useState(preset?.title || 'My Preset');
const endpointsFilter = useRecoilValue(store.endpointsFilter);
const endpointsConfig = useRecoilValue(store.endpointsConfig);
const createPresetMutation = useCreatePresetMutation();
const defaultTextProps =
@ -23,7 +23,7 @@ const SaveAsPresetDialog = ({ open, onOpenChange, preset }) => {
...preset,
title
},
endpointsFilter
endpointsConfig
});
createPresetMutation.mutate(_preset);
};