diff --git a/src/panels/ICHelperPanel.ts b/src/panels/ICHelperPanel.ts index 7823193..db6c137 100644 --- a/src/panels/ICHelperPanel.ts +++ b/src/panels/ICHelperPanel.ts @@ -547,22 +547,31 @@ export async function showICHelperPanel( console.log("[ICHelperPanel] pluginTrialExpiresAt:", userInfo?.pluginTrialExpiresAt); console.log("[ICHelperPanel] hasWelcomed:", hasWelcomed); - if (userInfo?.isPluginTrial === true && userInfo.pluginTrialExpiresAt !== null && userInfo.pluginTrialExpiresAt !== undefined) { - const now = Date.now(); - const isExpired = now >= userInfo.pluginTrialExpiresAt; - console.log("[ICHelperPanel] 是否过期:", isExpired); + if (userInfo?.isPluginTrial === true) { + // 如果有过期时间,检查是否过期 + if (userInfo.pluginTrialExpiresAt) { + const now = Date.now(); + const isExpired = now >= userInfo.pluginTrialExpiresAt; + console.log("[ICHelperPanel] 是否过期:", isExpired); - if (!isExpired && !hasWelcomed) { + if (isExpired) { + console.log("[ICHelperPanel] 试用已过期,不显示欢迎弹窗"); + break; + } + } + + // 未过期或无过期时间,且未显示过欢迎弹窗 + if (!hasWelcomed) { await context.globalState.update("pluginTrialWelcomed", true); console.log("[ICHelperPanel] ✅ 发送 showWelcomeModal 命令到前端"); panel.webview.postMessage({ command: "showWelcomeModal", }); } else { - console.log("[ICHelperPanel] 已过期或已显示过欢迎弹窗"); + console.log("[ICHelperPanel] 已显示过欢迎弹窗"); } } else { - console.log("[ICHelperPanel] 非试用用户或无过期时间"); + console.log("[ICHelperPanel] 非试用用户"); } } break;