Add more types

This commit is contained in:
Igor Carvalho 2023-08-07 18:05:02 -03:00
commit 396d5a3bd5
4 changed files with 8 additions and 6 deletions

View file

@ -36,9 +36,9 @@ function ApiInterceptor(): null {
"Refresh the page", "Refresh the page",
"Use a new flow tab", "Use a new flow tab",
"Check if the backend is up", "Check if the backend is up",
"Endpoint: " + error.config?.url, "Endpoint: " + (error as AxiosError).config?.url,
], ],
} as errorsVarType); });
return Promise.reject(error); return Promise.reject(error);
} }
} }

View file

@ -26,6 +26,7 @@ import { CHAT_FORM_DIALOG_SUBTITLE } from "../../constants/constants";
import { TabsContext } from "../../contexts/tabsContext"; import { TabsContext } from "../../contexts/tabsContext";
import { validateNodes } from "../../utils/reactflowUtils"; import { validateNodes } from "../../utils/reactflowUtils";
import { TabsState, errorsVarType } from "../../types/tabs"; import { TabsState, errorsVarType } from "../../types/tabs";
import { AxiosError } from "axios";
export default function FormModal({ export default function FormModal({
flow, flow,
@ -316,8 +317,8 @@ export default function FormModal({
} catch (error) { } catch (error) {
setErrorData({ setErrorData({
title: "There was an error sending the message", title: "There was an error sending the message",
list: [error.message], list: [(error as { message: string }).message],
} as errorsVarType); });
setChatValue(data.inputs); setChatValue(data.inputs);
connectWS(); connectWS();
} }

View file

@ -42,7 +42,7 @@ export default function GenericModal({
const [wordsHighlight, setWordsHighlight] = useState<string[]>([]); const [wordsHighlight, setWordsHighlight] = useState<string[]>([]);
const { setErrorData, setSuccessData, setNoticeData } = const { setErrorData, setSuccessData, setNoticeData } =
useContext(alertContext); useContext(alertContext);
const ref = useRef<RefObject<HTMLTextAreaElement>>(); const ref = useRef();
const divRef = useRef(null); const divRef = useRef(null);
const divRefPrompt = useRef(null); const divRefPrompt = useRef(null);
@ -208,6 +208,7 @@ export default function GenericModal({
<TextAreaContentView /> <TextAreaContentView />
) : type !== TypeModal.PROMPT ? ( ) : type !== TypeModal.PROMPT ? (
<Textarea <Textarea
//@ts-ignore
ref={ref} ref={ref}
className="form-input h-full w-full rounded-lg focus-visible:ring-1" className="form-input h-full w-full rounded-lg focus-visible:ring-1"
value={inputValue} value={inputValue}

View file

@ -6,7 +6,7 @@
"skipLibCheck": true, "skipLibCheck": true,
"esModuleInterop": true, "esModuleInterop": true,
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"strict": true, "strict": false,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"module": "esnext", "module": "esnext",