feat: 每次登录都显示试用用户欢迎弹窗

- 移除 hasWelcomed 标记,不再记录是否已显示
- 试用用户每次打开聊天面板都会看到欢迎弹窗
This commit is contained in:
Roe-xin
2026-03-03 19:19:37 +08:00
parent 76817675f1
commit 52834047f2

View File

@ -540,12 +540,10 @@ export async function showICHelperPanel(
{ {
console.log("[ICHelperPanel] 收到 checkWelcomeModal 消息"); console.log("[ICHelperPanel] 收到 checkWelcomeModal 消息");
const userInfo = getCachedUserInfo(); const userInfo = getCachedUserInfo();
const hasWelcomed = context.globalState.get("pluginTrialWelcomed");
console.log("[ICHelperPanel] 用户信息:", userInfo); console.log("[ICHelperPanel] 用户信息:", userInfo);
console.log("[ICHelperPanel] isPluginTrial:", userInfo?.isPluginTrial); console.log("[ICHelperPanel] isPluginTrial:", userInfo?.isPluginTrial);
console.log("[ICHelperPanel] pluginTrialExpiresAt:", userInfo?.pluginTrialExpiresAt); console.log("[ICHelperPanel] pluginTrialExpiresAt:", userInfo?.pluginTrialExpiresAt);
console.log("[ICHelperPanel] hasWelcomed:", hasWelcomed);
if (userInfo?.isPluginTrial === true) { if (userInfo?.isPluginTrial === true) {
// undefined 表示无效,不显示 // undefined 表示无效,不显示
@ -567,16 +565,11 @@ export async function showICHelperPanel(
} }
} }
// 未过期或长期有效(null)且未显示欢迎弹窗 // 未过期或长期有效(null),显示欢迎弹窗
if (!hasWelcomed) { console.log("[ICHelperPanel] ✅ 发送 showWelcomeModal 命令到前端");
await context.globalState.update("pluginTrialWelcomed", true); panel.webview.postMessage({
console.log("[ICHelperPanel] ✅ 发送 showWelcomeModal 命令到前端"); command: "showWelcomeModal",
panel.webview.postMessage({ });
command: "showWelcomeModal",
});
} else {
console.log("[ICHelperPanel] 已显示过欢迎弹窗");
}
} else { } else {
console.log("[ICHelperPanel] 非试用用户"); console.log("[ICHelperPanel] 非试用用户");
} }