Skip to content

Commit ad443e3

Browse files
Merge pull request #334 from microsoft/code-quality-fix
refactor: Code quality fix
2 parents fb5d638 + e640055 commit ad443e3

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

src/backend/sql_agents/convert_script.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ async def convert_script(
6666

6767
# orchestrate the chat
6868
current_migration = "No migration"
69-
is_complete: bool = False
70-
while not is_complete:
69+
while True:
7170
await comms_manager.group_chat.add_chat_message(
7271
ChatMessageContent(role=AuthorRole.USER, content=source_script)
7372
)
@@ -274,9 +273,7 @@ async def convert_script(
274273
break
275274

276275
if comms_manager.group_chat.is_complete:
277-
is_complete = True
278-
279-
break
276+
break
280277

281278
migrated_query = current_migration
282279

src/frontend/src/pages/landingPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useRef, useState } from "react";
1+
import React, { useEffect, useState } from "react";
22
import { useSelector, useDispatch } from "react-redux";
33
import { RootState } from "../store/store";
44
import { togglePanel, closePanel } from "../slices/historyPanelSlice";

src/frontend/src/pages/modernizationPage.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { Light as SyntaxHighlighter } from "react-syntax-highlighter"
3131
import { vs } from "react-syntax-highlighter/dist/esm/styles/hljs"
3232
import sql from "react-syntax-highlighter/dist/cjs/languages/hljs/sql"
3333
import { useNavigate, useParams } from "react-router-dom"
34-
import { useState, useEffect, useCallback, useRef } from "react"
34+
import { useState, useEffect, useCallback } from "react"
3535
import { getApiUrl, headerBuilder } from '../api/config';
3636
import BatchHistoryPanel from "../components/batchHistoryPanel"
3737
import PanelRight from "../components/Panels/PanelRight";
@@ -515,9 +515,18 @@ const ModernizationPage = () => {
515515
if (!selectedFile || !selectedFile.translatedCode) {
516516
setFileLoading(true);
517517
const newFileUpdate = await fetchFileFromAPI(selectedFile?.fileId || "");
518+
setFiles((prevFiles) =>
519+
prevFiles.map((file) =>
520+
file.fileId === selectedFile?.fileId
521+
? {
522+
...file,
523+
code: newFileUpdate.content,
524+
translatedCode: newFileUpdate.translated_content,
525+
}
526+
: file
527+
)
528+
);
518529
setFileLoading(false);
519-
} else {
520-
521530
}
522531

523532
} catch (err) {

0 commit comments

Comments
 (0)