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 37
37
"stats" : " npm run --silent package -- --env namedChunks=true --profile --json > ./dist/stats.json && webpack-bundle-analyzer ./dist/stats.json ./dist"
38
38
},
39
39
"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"
49
41
],
50
42
"main" : " ./dist/extension.js" ,
51
43
"contributes" : {
769
761
{
770
762
"id" : " cnblogs-authorize" ,
771
763
"name" : " 登录/授权" ,
772
- "when" : " ! vscode-cnb.isAuthed " ,
764
+ "when" : " vscode-cnb.isUnauthorized " ,
773
765
"visibility" : " visible"
774
766
},
775
767
{
776
768
"id" : " vscode-cnb-workspace" ,
777
769
"name" : " 工作空间" ,
778
- "when" : " vscode-cnb.isAuthed " ,
770
+ "when" : " ! vscode-cnb.isUnauthorized " ,
779
771
"visibility" : " collapsed"
780
772
},
781
773
{
Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ export namespace AuthManager {
107
107
108
108
await execCmd ( 'setContext' , `${ globalCtx . extName } .isAuthed` , isAuthed )
109
109
110
+ await execCmd ( 'setContext' , `${ globalCtx . extName } .isUnauthorized` , ! isAuthed )
111
+
110
112
if ( ! isAuthed ) return
111
113
112
114
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) {
16
16
// WRN: For old version compatibility, NEVER remove this line
17
17
void LocalState . delSecret ( 'user' )
18
18
19
+ await AuthManager . updateAuthStatus ( )
20
+
19
21
setupExtCmd ( )
20
22
setupExtTreeView ( )
21
23
@@ -28,8 +30,6 @@ export async function activate(ctx: ExtensionContext) {
28
30
29
31
window . registerUriHandler ( extUriHandler )
30
32
31
- await AuthManager . updateAuthStatus ( )
32
-
33
33
setupUi ( LocalState . getExtCfg ( ) )
34
34
35
35
return { extendMarkdownIt }
You can’t perform that action at this time.
0 commit comments