File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -121,9 +121,9 @@ function resetPluginApi (context) {
121
121
const projects = require ( './projects' )
122
122
const project = projects . getCurrent ( context )
123
123
if ( ! project ) return
124
+ projectId = project . id
125
+ pluginApi . project = project
124
126
if ( projectId !== project . id ) {
125
- projectId = project . id
126
- pluginApi . project = project
127
127
callHook ( 'projectOpen' , [ project , projects . getLast ( context ) ] , context )
128
128
} else {
129
129
callHook ( 'pluginReload' , [ project ] , context )
Original file line number Diff line number Diff line change @@ -23,6 +23,17 @@ module.exports = api => {
23
23
'modern-mode' : false
24
24
}
25
25
26
+ // Init data
27
+ api . onProjectOpen ( setup )
28
+ api . onPluginReload ( setup )
29
+
30
+ function setup ( ) {
31
+ for ( const key of [ 'serve' , 'build' , 'build-modern' ] ) {
32
+ setupSharedData ( key )
33
+ }
34
+ setupCommonData ( )
35
+ }
36
+
26
37
// Called when opening a project
27
38
function setupSharedData ( mode ) {
28
39
resetSharedData ( mode )
@@ -141,14 +152,6 @@ module.exports = api => {
141
152
}
142
153
}
143
154
144
- // Init data
145
- api . onProjectOpen ( ( ) => {
146
- for ( const key of [ 'serve' , 'build' , 'build-modern' ] ) {
147
- setupSharedData ( key )
148
- }
149
- setupCommonData ( )
150
- } )
151
-
152
155
// Tasks
153
156
const views = {
154
157
views : [
You can’t perform that action at this time.
0 commit comments