feat(auth): 添加登录状态检查,
- 未登录时不会自动打开面板命令打开也会显示需要登录 - 登录之后就回自动打开对话面板
This commit is contained in:
@ -18,8 +18,15 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
)
|
||||
);
|
||||
|
||||
// 自动打开聊天面板
|
||||
vscode.commands.executeCommand("ic-coder.openChat");
|
||||
// 检查登录状态,如果已登录则自动打开聊天面板
|
||||
vscode.authentication.getSession("iccoder", [], { createIfNone: false })
|
||||
.then((session) => {
|
||||
if (session) {
|
||||
vscode.commands.executeCommand("ic-coder.openChat");
|
||||
}
|
||||
}, () => {
|
||||
// 未登录,不做任何操作
|
||||
});
|
||||
|
||||
// 注册命令:打开助手面板
|
||||
const openPanelCommand = vscode.commands.registerCommand(
|
||||
|
||||
Reference in New Issue
Block a user