File tree Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 3737 "stats" : " npm run --silent package -- --env namedChunks=true --profile --json > ./dist/stats.json && webpack-bundle-analyzer ./dist/stats.json ./dist"
3838 },
3939 "activationEvents" : [
40- " workspaceContains:**" ,
41- " onView:cnblogs-authorize" ,
42- " onView:cnblogs-account" ,
43- " onView:cnblogs-post-list" ,
44- " onView:vscode-cnb-workspace" ,
45- " onCommand:vscode-cnb.workspace.code-open" ,
46- " onCommand:vscode-cnb.login.web" ,
47- " onCommand:vscode-cnb.logout" ,
48- " onCommand:vscode-cnb.ing-publish-select"
40+ " onStartupFinished"
4941 ],
5042 "main" : " ./dist/extension.js" ,
5143 "contributes" : {
769761 {
770762 "id" : " cnblogs-authorize" ,
771763 "name" : " 登录/授权" ,
772- "when" : " ! vscode-cnb.isAuthed " ,
764+ "when" : " vscode-cnb.isUnauthorized " ,
773765 "visibility" : " visible"
774766 },
775767 {
776768 "id" : " vscode-cnb-workspace" ,
777769 "name" : " 工作空间" ,
778- "when" : " vscode-cnb.isAuthed " ,
770+ "when" : " ! vscode-cnb.isUnauthorized " ,
779771 "visibility" : " collapsed"
780772 },
781773 {
Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ export namespace AuthManager {
107107
108108 await execCmd ( 'setContext' , `${ globalCtx . extName } .isAuthed` , isAuthed )
109109
110+ await execCmd ( 'setContext' , `${ globalCtx . extName } .isUnauthorized` , ! isAuthed )
111+
110112 if ( ! isAuthed ) return
111113
112114 await execCmd ( 'setContext' , `${ globalCtx . extName } .user` , {
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ export async function activate(ctx: ExtensionContext) {
1616 // WRN: For old version compatibility, NEVER remove this line
1717 void LocalState . delSecret ( 'user' )
1818
19+ await AuthManager . updateAuthStatus ( )
20+
1921 setupExtCmd ( )
2022 setupExtTreeView ( )
2123
@@ -28,8 +30,6 @@ export async function activate(ctx: ExtensionContext) {
2830
2931 window . registerUriHandler ( extUriHandler )
3032
31- await AuthManager . updateAuthStatus ( )
32-
3333 setupUi ( LocalState . getExtCfg ( ) )
3434
3535 return { extendMarkdownIt }
You can’t perform that action at this time.
0 commit comments