Skip to content

Commit

Permalink
Added thread si to url
Browse files Browse the repository at this point in the history
  • Loading branch information
Bianca Wentzel committed Sep 9, 2024
1 parent ee64840 commit 487b9f7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion assets/js/Containers/FrevaGPT/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState, useEffect } from 'react';
import { Container, Row, Col, FormControl, InputGroup, Card } from 'react-bootstrap';
import JSONStream from 'JSONStream';
import { browserHistory } from "react-router";

import Spinner from "../../Components/Spinner";

Expand Down Expand Up @@ -51,7 +52,13 @@ const ChatBot = () => {
botAnswer = botAnswer + value.content;
} else if (value.variant === 'ServerHint') {
// TODO test for key: warning or of thread_id is even included in an object
if (thread === "") setThread(JSON.parse(value.content).thread_id);
if (thread === "") {
setThread(JSON.parse(value.content).thread_id);
browserHistory.push({
pathname: '/chatbot',
search: `?thread_id=${JSON.parse(value.content).thread_id}`
});
}
}
});

Expand Down

0 comments on commit 487b9f7

Please sign in to comment.