From d58fe640ff59efcfc16c3bea1732aa407d1f36e8 Mon Sep 17 00:00:00 2001 From: ruotongyu Date: Tue, 11 Jun 2024 22:20:58 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20=E6=9B=B4=E6=96=B0(package-lock.?= =?UTF-8?q?json)=EF=BC=9A=E4=BF=AE=E5=A4=8D@icon-park/react=E5=8C=85?= =?UTF-8?q?=E7=9A=84resolved=E9=93=BE=E6=8E=A5=E5=9C=B0=E5=9D=80=20?= =?UTF-8?q?=F0=9F=94=A7=20=E6=9B=B4=E6=96=B0(config/index.ts)=EF=BC=9A?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AA=97=E5=8F=A3=E5=88=9B=E5=BB=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E8=A7=A3=E5=86=B3=E9=87=8D=E5=A4=8D=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E7=AA=97=E5=8F=A3=E7=9A=84=E9=97=AE=E9=A2=98=20?= =?UTF-8?q?=F0=9F=94=A7=20=E6=9B=B4=E6=96=B0(Search/index.tsx)=EF=BC=9A?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=90=9C=E7=B4=A2=E7=BB=84=E4=BB=B6=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E5=92=8C=E6=8C=89=E9=92=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/autoMate/package-lock.json | 2 +- ui/autoMate/src/main/config/index.ts | 9 ++++++++- .../src/renderer/src/components/Search/index.tsx | 16 +++++----------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ui/autoMate/package-lock.json b/ui/autoMate/package-lock.json index 7c0d2a5..dea39ff 100644 --- a/ui/autoMate/package-lock.json +++ b/ui/autoMate/package-lock.json @@ -1385,7 +1385,7 @@ }, "node_modules/@icon-park/react": { "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@icon-park/react/-/react-1.4.2.tgz", + "resolved": "https://registry.npmmirror.com/@icon-park/react/-/react-1.4.2.tgz", "integrity": "sha512-+MtQLjNiRuia3fC/NfpSCTIy5KH5b+NkMB9zYd7p3R4aAIK61AjK0OSraaICJdkKooU9jpzk8m0fY4g9A3JqhQ==", "engines": { "node": ">= 8.0.0", diff --git a/ui/autoMate/src/main/config/index.ts b/ui/autoMate/src/main/config/index.ts index cba4375..b63cbc1 100644 --- a/ui/autoMate/src/main/config/index.ts +++ b/ui/autoMate/src/main/config/index.ts @@ -1,6 +1,13 @@ +import { BrowserWindow } from "electron" import { createWindow } from "./window" +let win = null as null|BrowserWindow const createConfigWindow=()=>{ - createWindow() + // 解决重复创建窗口 + if(!win) win = createWindow() + // 窗口关闭时,将win置为null,可再次打开 + win.on("closed", ()=>{ + win = null + }) } export { createConfigWindow } diff --git a/ui/autoMate/src/renderer/src/components/Search/index.tsx b/ui/autoMate/src/renderer/src/components/Search/index.tsx index c2b1431..97869fb 100644 --- a/ui/autoMate/src/renderer/src/components/Search/index.tsx +++ b/ui/autoMate/src/renderer/src/components/Search/index.tsx @@ -6,17 +6,16 @@ export default function Search(): JSX.Element { const search = useStore((state)=>state.search) const {handleSearch} = useSearch() return ( -
-
+
+
{ - window.api.openConfigWindow() - }} + onClick={()=>window.api.openConfigWindow() + } /> - {/* */}
autoMate