mirror of
https://github.com/yuruotong1/autoMate.git
synced 2026-03-22 13:07:17 +08:00
更新提示信息
This commit is contained in:
@@ -7,7 +7,7 @@ export const config = {
|
||||
options: {
|
||||
initShow: true,
|
||||
hash: '',
|
||||
openDevTools: false,
|
||||
openDevTools: true,
|
||||
}
|
||||
},
|
||||
code: {
|
||||
|
||||
@@ -6,7 +6,7 @@ function Error(){
|
||||
const error = useStore(state => state.error)
|
||||
const setError = useStore(state => state.setError)
|
||||
useEffect(() => {
|
||||
const id = setTimeout(() => setError(""), 2000)
|
||||
const id = setTimeout(() => setError(""), 20000)
|
||||
return () => clearTimeout(id)
|
||||
}, [error])
|
||||
if (!error) return <></>
|
||||
|
||||
@@ -16,7 +16,7 @@ export default function Search(): JSX.Element {
|
||||
}
|
||||
/>
|
||||
<Input
|
||||
placeholder="请输入内容"
|
||||
placeholder="请输入常用的action名字以快速调用"
|
||||
onChange={handleSearch}
|
||||
autoFocus
|
||||
/>
|
||||
|
||||
@@ -4,6 +4,7 @@ import { CodeProvider } from "@renderer/context/CodeContext"
|
||||
import Error from "@renderer/components/Error"
|
||||
import { MutableRefObject, useEffect, useRef } from "react"
|
||||
import useIgnoreMouseEvents from "@renderer/hooks/useIgnoreMouseEvents"
|
||||
import { useStore } from "@renderer/store/useStore"
|
||||
|
||||
|
||||
function Home(): JSX.Element {
|
||||
@@ -12,14 +13,19 @@ function Home(): JSX.Element {
|
||||
window.api.initTable()
|
||||
// 注册快捷键
|
||||
window.api.shortCut()
|
||||
|
||||
|
||||
const setError = useStore((state)=>state.setError)
|
||||
useEffect(()=>{
|
||||
setIgnoreMouseEvents(mainRef as MutableRefObject<HTMLDivElement>)
|
||||
// //为开发方便,临时代码
|
||||
// window.api.openConfigWindow()
|
||||
|
||||
}, [])
|
||||
window.api.getConfig().then((res)=>{
|
||||
const config = JSON.parse(res.content) as ConfigDataType
|
||||
if (config.llm.apiKey=="sk-xxx") {
|
||||
setError("没有检测到大模型信息,请“点击配置”进行配置。如有疑问可查看文档:https://s0soyusc93k.feishu.cn/wiki/JhhIwAUXJiBHG9kmt3YcXisWnec")
|
||||
}
|
||||
})
|
||||
|
||||
return (
|
||||
<CodeProvider>
|
||||
|
||||
Reference in New Issue
Block a user