Skip to content

Commit

Permalink
[enhance] change let to const when can use const
Browse files Browse the repository at this point in the history
**Phenomenon and reproduction steps**

none

**Root cause and solution**

none

**Impactions**

none

**Test method**

none

**Affected branch(es)**

- main

**Checklist**

- [ ] Dependencies update required
- [ ] Common bug (similar problem in other repo)
  • Loading branch information
twou12031 committed Apr 26, 2024
1 parent 69465e8 commit 1df84d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions deepflow-apptracing-panel/src/components/AskGPT.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ export const AskGPT: React.FC<Props> = ({ data }) => {
if (answerIsEnd) {
return htmlText
}
let parser = new DOMParser()
let doc = parser.parseFromString(htmlText, 'text/html')
let target = findLastVisibleTextNode(doc) as any
const parser = new DOMParser()
const doc = parser.parseFromString(htmlText, 'text/html')
const target = findLastVisibleTextNode(doc) as any
if (!target) {
return htmlText
}
let newTextElement = document.createElement('b')
const newTextElement = document.createElement('b')
newTextElement.setAttribute('class', 'blink')
if (target.nodeType === Node.TEXT_NODE) {
target.parentNode.appendChild(newTextElement)
Expand Down
8 changes: 4 additions & 4 deletions deepflow-topo-panel/src/components/AskGPT.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ export const AskGPT: React.FC<Props> = ({ data }) => {
if (answerIsEnd) {
return htmlText
}
let parser = new DOMParser()
let doc = parser.parseFromString(htmlText, 'text/html')
let target = findLastVisibleTextNode(doc) as any
const parser = new DOMParser()
const doc = parser.parseFromString(htmlText, 'text/html')
const target = findLastVisibleTextNode(doc) as any
if (!target) {
return htmlText
}
let newTextElement = document.createElement('b')
const newTextElement = document.createElement('b')
newTextElement.setAttribute('class', 'blink')
if (target.nodeType === Node.TEXT_NODE) {
target.parentNode.appendChild(newTextElement)
Expand Down

0 comments on commit 1df84d2

Please sign in to comment.