Revert "Removed some of the calls to process.env; Used server props instead"
This reverts commit f51f36a411.
This commit is contained in:
parent
f51f36a411
commit
73bf7f3d79
5 changed files with 11 additions and 52 deletions
|
|
@ -260,7 +260,7 @@ const loadMessages = async (
|
|||
setIsMessagesLoaded(true);
|
||||
};
|
||||
|
||||
const ChatWindow = ({ id, backendApiUrl }: { id?: string, backendApiUrl: string }) => {
|
||||
const ChatWindow = ({ id }: { id?: string }) => {
|
||||
const searchParams = useSearchParams();
|
||||
const initialMessage = searchParams.get('q');
|
||||
|
||||
|
|
@ -434,7 +434,7 @@ const ChatWindow = ({ id, backendApiUrl }: { id?: string, backendApiUrl: string
|
|||
lastMsg.sources.length > 0 &&
|
||||
!lastMsg.suggestions
|
||||
) {
|
||||
const suggestions = await getSuggestions(messagesRef.current, backendApiUrl);
|
||||
const suggestions = await getSuggestions(messagesRef.current);
|
||||
setMessages((prev) =>
|
||||
prev.map((msg) => {
|
||||
if (msg.messageId === lastMsg.messageId) {
|
||||
|
|
|
|||
|
|
@ -9,12 +9,10 @@ const DeleteChat = ({
|
|||
chatId,
|
||||
chats,
|
||||
setChats,
|
||||
backendApiUrl
|
||||
}: {
|
||||
chatId: string;
|
||||
chats: Chat[];
|
||||
setChats: (chats: Chat[]) => void;
|
||||
backendApiUrl: string
|
||||
}) => {
|
||||
const [confirmationDialogOpen, setConfirmationDialogOpen] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
|
@ -23,7 +21,7 @@ const DeleteChat = ({
|
|||
setLoading(true);
|
||||
try {
|
||||
const res = await fetch(
|
||||
`${backendApiUrl}/chats/${chatId}`,
|
||||
`${process.env.BACKEND_API_URL}/chats/${chatId}`,
|
||||
{
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue