Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion report-front-end/src/common/api/WebSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function createWssClient(
setStatusMessage: Dispatch<SetStateAction<ChatBotMessageItem[]>>,
setMessageHistory: Dispatch<SetStateAction<ChatBotHistoryItem[]>>
) {
const socketUrl = process.env.VITE_WEBSOCKET_URL;
const socketUrl = process.env.VITE_WEBSOCKET_URL as string;
const {sendJsonMessage}
// eslint-disable-next-line react-hooks/rules-of-hooks
= useWebSocket(socketUrl, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Link, SpaceBetween } from "@cloudscape-design/components";
import { Dispatch, SetStateAction, useEffect, useState } from "react";
import { Button } from "@aws-amplify/ui-react";
import { ChatBotHistoryItem, ChatInputState } from "./types";
import { BACKEND_URL, DEFAULT_QUERY_CONFIG } from "../../common/constant/constants";
import { BACKEND_URL } from "../../common/constant/constants";
import { useSelector } from "react-redux";
import { UserState } from "../config-panel/types";
import styles from "./chat.module.scss";
Expand Down Expand Up @@ -43,9 +43,11 @@ export default function CustomQuestions(props: RecommendQuestionsProps) {
}

useEffect(() => {
const data_profile = DEFAULT_QUERY_CONFIG.selectedDataPro;
getRecommendQuestions(data_profile).then();
}, []);
const data_profile = userInfo.queryConfig.selectedDataPro;
if (data_profile) {
getRecommendQuestions(data_profile).then();
}
}, [userInfo.queryConfig.selectedDataPro]);

const handleSendMessage = (question: string) => {
// Call Fast API
Expand Down
1 change: 1 addition & 0 deletions report-front-end/src/components/config-panel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ const ConfigPanel = () => {
};
dispatch({ type: ActionType.UpdateConfig, state: configInfo });
};

return (
<HelpPanel header="Configuration">
<SpaceBetween size="l">
Expand Down