Skip to content

Commit

Permalink
Fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Bianca Wentzel committed Dec 11, 2024
1 parent 6bae178 commit 5996571
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
9 changes: 4 additions & 5 deletions assets/js/Containers/FrevaGPT/components/AnswerComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@ import Highlight from "react-highlight";
import "highlight.js/styles/atom-one-light.css";

function AnswerComponent(props) {

function renderCode(rawCode) {
let jsonCode = "";
let codeSnippets = "";
let codeSnippets = "";

if (!rawCode.endsWith('"}')) jsonCode = rawCode + '"}';
else jsonCode = rawCode;

try {
const code = JSON.parse(jsonCode);
codeSnippets = code.code;
} catch(err) {
} catch (err) {
// console.error(err);
}
return codeSnippets;
Expand All @@ -47,7 +46,7 @@ function AnswerComponent(props) {
<Accordion.Body>
<Highlight>{renderCode(props.content)}</Highlight>
<span>
<Spinner size="sm"/>
<Spinner size="sm" />
<span className="m-2">Analyzing...</span>
</span>
</Accordion.Body>
Expand All @@ -60,7 +59,7 @@ function AnswerComponent(props) {
return (
<Row className="mb-3">
<Col md={1}>
<Spinner/>
<Spinner />
</Col>
</Row>
);
Expand Down
5 changes: 4 additions & 1 deletion assets/js/Containers/FrevaGPT/components/ChatBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ class ChatBlock extends React.Component {
renderUser(element) {
return (
<Col md={{ span: 10, offset: 2 }} key={element.content}>
<Card className="shadow-sm card-body border-0 border-bottom mb-3" style={{backgroundColor: '#eee'}}>
<Card
className="shadow-sm card-body border-0 border-bottom mb-3"
style={{ backgroundColor: "#eee" }}
>
{element.content}
</Card>
</Col>
Expand Down
6 changes: 5 additions & 1 deletion assets/js/Containers/FrevaGPT/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ class FrevaGPT extends React.Component {
} catch (err) {
// ServerHints and CodeBlocks include nested JSON Objects
// eslint-disable-next-line no-console
if (!subBuffer.includes("ServerHint") && !subBuffer.includes("Code")) console.error(err);
if (
!subBuffer.includes("ServerHint") &&
!subBuffer.includes("Code")
)
console.error(err);
}
}
}
Expand Down

0 comments on commit 5996571

Please sign in to comment.