From 3bd39350426ca5e7fa5c0e53decb0393ee1a847c Mon Sep 17 00:00:00 2001 From: Wxw-Gu <84499436+Wxw-Gu@users.noreply.github.com> Date: Thu, 24 Sep 2026 10:49:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dmac=E5=8F=91=E9=80=81?= =?UTF-8?q?=20=E5=88=9D=E5=A7=8B=E5=8C=96=E5=8D=A1=E5=9C=A8'=E6=AD=A3?= =?UTF-8?q?=E5=9C=A8=E6=A3=80=E6=9F=A5=20=E5=8F=91=E9=80=81=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E6=97=B6=E2=80=A6'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/services/mac-wechat-runtime-manager.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/services/mac-wechat-runtime-manager.ts b/src/main/services/mac-wechat-runtime-manager.ts index 2fa02ec..3166343 100644 --- a/src/main/services/mac-wechat-runtime-manager.ts +++ b/src/main/services/mac-wechat-runtime-manager.ts @@ -492,6 +492,20 @@ class MacWechatRuntimeManager { * circular import. */ async buildSenderStatus(): Promise { + /* + * Lazy-start the host from status reads. + * + * Every UI surface discovers the runtime through this method, and the + * setup guide renders "正在检查 发送运行时…" while runtimeReady is false — + * where runtimeReady means lifecycle === 'online'. If nothing here brings a + * stopped host up, opening the app (with WeChat already logged in, so no + * send is ever attempted) leaves that step spinning forever: the check can + * never succeed because the check itself is what should start the host. + * Starting it never touches WeChat, so doing it from a read is safe. + */ + if (this.lifecycle === 'stopped') { + await this.ensureStarted().catch(() => undefined) + } /* Self-heal the status card too: if WeChat was restarted, drop the stale * restartRequired before it is read into the UI as an error. */ try {