Skip to content

Commit

Permalink
暂存
Browse files Browse the repository at this point in the history
  • Loading branch information
song-xiao-lin committed Dec 12, 2023
1 parent df5959d commit 9813fae
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {failed, info, success, yakitFailed, yakitNotify} from "@/utils/notificat
import {showModal} from "@/utils/showModal"
import {YaklangEngineMode} from "@/yakitGVDefine"
import {LoadingOutlined} from "@ant-design/icons"
import {useInViewport, useMemoizedFn} from "ahooks"
import {useGetState, useInViewport, useMemoizedFn} from "ahooks"
import {Popconfirm} from "antd"
import {Sparklines, SparklinesCurve} from "react-sparklines"
import {YakitButton} from "../yakitUI/YakitButton/YakitButton"
Expand Down Expand Up @@ -117,7 +117,7 @@ const UIEngineList: React.FC<UIEngineListProp> = React.memo((props) => {
const [psLoading, setPSLoading] = useState<boolean>(false)
const [process, setProcess] = useState<yakProcess[]>([])
const {runNodeList} = useRunNodeStore()
const [port, setPort] = useState<number>(0)
const [port, setPort, getPort] = useGetState<number>(0)

const fetchPSList = useMemoizedFn(() => {
if (psLoading) return
Expand Down Expand Up @@ -208,6 +208,7 @@ const UIEngineList: React.FC<UIEngineListProp> = React.memo((props) => {

// 删除临时项目
await ipcRenderer.invoke("DeleteProject", {Id: +lastTemporaryProjectIdRef.current, IsDeleteLocal: true})
yakitNotify("success", "删除临时项目成功")
setTemporaryProjectId("")
lastTemporaryProjectIdRef.current = ""
}
Expand Down Expand Up @@ -323,11 +324,13 @@ const UIEngineList: React.FC<UIEngineListProp> = React.memo((props) => {
</>
}
onConfirm={async () => {
+i.port === port && await handleTemporaryProject()
console.log('是否执行', isLocal, +i.port, port, getPort());
isLocal && +i.port === port && await handleTemporaryProject()
ipcRenderer
.invoke("kill-yak-grpc", i.pid)
.then((val) => {
if (!val) {
console.log('返回项目启动页', isLocal, +i.port, port, getPort());
isLocal && +i.port === port && typeCallback("break")
success("引擎进程关闭中...")
}
Expand Down

0 comments on commit 9813fae

Please sign in to comment.