@@ -61,7 +61,7 @@ export class EditorGroupWatermark extends Disposable {
61
61
62
62
private readonly shortcuts : HTMLElement ;
63
63
private transientDisposables = this . _register ( new DisposableStore ( ) ) ;
64
- private enabled : boolean ;
64
+ private enabled : boolean = false ;
65
65
private workbenchState : WorkbenchState ;
66
66
67
67
constructor (
@@ -83,39 +83,23 @@ export class EditorGroupWatermark extends Disposable {
83
83
append ( container , elements . root ) ;
84
84
this . shortcuts = elements . shortcuts ;
85
85
86
- this . workbenchState = contextService . getWorkbenchState ( ) ;
87
- this . enabled = this . configurationService . getValue < boolean > ( 'workbench.tips.enabled' ) ;
88
-
89
86
this . registerListeners ( ) ;
90
87
91
- if ( this . enabled ) {
92
- this . render ( ) ;
93
- }
88
+ this . workbenchState = contextService . getWorkbenchState ( ) ;
89
+ this . render ( ) ;
94
90
}
95
91
96
92
private registerListeners ( ) : void {
97
93
this . lifecycleService . onDidShutdown ( ( ) => this . dispose ( ) ) ;
98
94
99
95
this . _register ( this . configurationService . onDidChangeConfiguration ( e => {
100
96
if ( e . affectsConfiguration ( 'workbench.tips.enabled' ) ) {
101
- const enabled = this . configurationService . getValue < boolean > ( 'workbench.tips.enabled' ) ;
102
-
103
- if ( enabled === this . enabled ) {
104
- return ;
105
- }
106
-
107
- this . enabled = enabled ;
108
-
109
- if ( this . enabled ) {
110
- this . render ( ) ;
111
- } else {
112
- this . clear ( ) ;
113
- }
97
+ this . render ( ) ;
114
98
}
115
99
} ) ) ;
116
100
117
101
this . _register ( this . contextService . onDidChangeWorkbenchState ( workbenchState => {
118
- if ( ! this . enabled || this . workbenchState === workbenchState ) {
102
+ if ( this . workbenchState === workbenchState ) {
119
103
return ;
120
104
}
121
105
@@ -134,8 +118,19 @@ export class EditorGroupWatermark extends Disposable {
134
118
}
135
119
136
120
private render ( ) : void {
121
+ const enabled = this . configurationService . getValue < boolean > ( 'workbench.tips.enabled' ) ;
122
+
123
+ if ( enabled === this . enabled ) {
124
+ return ;
125
+ }
126
+
127
+ this . enabled = enabled ;
137
128
this . clear ( ) ;
138
129
130
+ if ( ! enabled ) {
131
+ return ;
132
+ }
133
+
139
134
const box = append ( this . shortcuts , $ ( '.watermark-box' ) ) ;
140
135
const folder = this . workbenchState !== WorkbenchState . EMPTY ;
141
136
const selected = ( folder ? folderEntries : noFolderEntries )
0 commit comments