Skip to content

Commit

Permalink
fix: sonarqube scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
wkylin committed Oct 24, 2024
1 parent 7ba27c9 commit 0ed957e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
/.idea
/dist
/.scannerwork
/node_modules
/.eslintcache
compilation-stats.json
Expand Down
2 changes: 1 addition & 1 deletion src/components/hooks/proTabsContext/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const initialPanes = [
const ProTabContext = createContext(defaultValue)
const useProTabContext = () => {
const context = useContext(ProTabContext)
if (context === undefined) {
if (context == undefined) {
throw new Error('useValue must be used within a ValueProvider')
}
return context
Expand Down
9 changes: 2 additions & 7 deletions src/pages/home/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { version, useState, useRef } from 'react'
import React, { version, useState, useRef } from 'react'
import { Input, Flex, Button } from 'antd'
import { SendOutlined } from '@ant-design/icons'
import FixTabPanel from '@stateless/FixTabPanel'
Expand Down Expand Up @@ -79,12 +79,7 @@ const Home = () => {
.then((response) => {
const contentType = response.headers.get('content-type')
if (!response.ok || !contentType?.startsWith('text/event-stream') || response.status !== 200) {
if (contentType?.startsWith('text/html')) {
const textPlain = response.clone().text()
textPlain.then((plainText) => {
setAiText(plainText)
})
} else if (contentType?.startsWith('text/plain')) {
if (contentType?.startsWith('text/html') || contentType?.startsWith('text/plain')) {
const textPlain = response.clone().text()
textPlain.then((plainText) => {
setAiText(plainText)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/aidFn.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parse, stringify } from 'qs'
import { parse, stringify } from 'qs'
import html2canvas from 'html2canvas'

export const getEnv = () => {
Expand Down

0 comments on commit 0ed957e

Please sign in to comment.