fix bug
This commit is contained in:
@@ -12,7 +12,7 @@ interface Props {
|
||||
|
||||
export default function KLineChart({ kline, realtime, addedDate, stockCode, stockName }: Props) {
|
||||
const chartRef = useRef<HTMLDivElement>(null)
|
||||
const instance = useRef<echarts.ECharts>()
|
||||
const instance = useRef<echarts.ECharts>(null)
|
||||
|
||||
useEffect(() => {
|
||||
if (!chartRef.current) return
|
||||
|
||||
@@ -10,7 +10,7 @@ export default function SearchBar({ onSelect }: Props) {
|
||||
const [query, setQuery] = useState('')
|
||||
const [results, setResults] = useState<StockItem[]>([])
|
||||
const [open, setOpen] = useState(false)
|
||||
const timer = useRef<ReturnType<typeof setTimeout>>()
|
||||
const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)
|
||||
const ref = useRef<HTMLDivElement>(null)
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -29,18 +29,6 @@ export default function HomePage() {
|
||||
window.location.reload()
|
||||
}
|
||||
|
||||
const handleAddToExisting = async (colId: number) => {
|
||||
if (!pendingStock) return
|
||||
await addStock(colId, {
|
||||
code: pendingStock.code,
|
||||
name: pendingStock.name,
|
||||
added_date: addedDate,
|
||||
})
|
||||
setShowModal(false)
|
||||
setPendingStock(null)
|
||||
window.location.reload()
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{ maxWidth: 800, margin: '0 auto', padding: '24px 16px' }}>
|
||||
<h1 style={{ fontSize: 24, fontWeight: 700, marginBottom: 8 }}>A股追踪</h1>
|
||||
|
||||
Reference in New Issue
Block a user