🔧 fix(ApiModal/index.tsx): fix formatting of codesArray to improve readability

🔧 fix(formModal/index.tsx): fix formatting of getWebSocketUrl function to improve readability
🔧 fix(vite.config.ts): fix formatting of comment to improve readability
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-15 16:46:53 -03:00
commit 5e715af875
3 changed files with 10 additions and 3 deletions

View file

@ -49,7 +49,13 @@ const ApiModal = forwardRef(
const pythonCode = getPythonCode(flow, tweak.current, tabsState); const pythonCode = getPythonCode(flow, tweak.current, tabsState);
const widgetCode = getWidgetCode(flow, tabsState); const widgetCode = getWidgetCode(flow, tabsState);
const tweaksCode = buildTweaks(flow); const tweaksCode = buildTweaks(flow);
const codesArray = [curl_code, pythonApiCode, pythonCode, widgetCode, pythonCode]; const codesArray = [
curl_code,
pythonApiCode,
pythonCode,
widgetCode,
pythonCode,
];
const [tabs, setTabs] = useState(tabsArray(codesArray, 0)); const [tabs, setTabs] = useState(tabsArray(codesArray, 0));
function startState() { function startState() {

View file

@ -160,7 +160,8 @@ export default function FormModal({
} }
function getWebSocketUrl(chatId, isDevelopment = false) { function getWebSocketUrl(chatId, isDevelopment = false) {
const isSecureProtocol = window.location.protocol === "https:" || window.location.port === "443"; const isSecureProtocol =
window.location.protocol === "https:" || window.location.port === "443";
const webSocketProtocol = isSecureProtocol ? "wss" : "ws"; const webSocketProtocol = isSecureProtocol ? "wss" : "ws";
const host = isDevelopment ? "localhost:7860" : window.location.host; const host = isDevelopment ? "localhost:7860" : window.location.host;
const chatEndpoint = `/api/v1/chat/${chatId}`; const chatEndpoint = `/api/v1/chat/${chatId}`;