File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export function consumeStatusBar (statusBar) {
31
31
const showTile = ( ) => tileDom . style . display = ''
32
32
const hideTile = ( ) => tileDom . style . display = 'none'
33
33
const updateTile = ( proj ) => {
34
- if ( ! proj ) return
34
+ if ( ! proj ) return hideTile ( )
35
35
projectName = proj . name
36
36
dom . innerText = 'Env: ' + projectName
37
37
projectPath = proj . path
@@ -55,20 +55,24 @@ export function consumeStatusBar (statusBar) {
55
55
}
56
56
} else {
57
57
client . require ( 'choose environment' , ( ) => {
58
- const p = allProjects ( )
59
- . then ( proj => {
60
- return proj . map ( proj => {
58
+ allProjects ( )
59
+ . then ( projs => {
60
+ if ( ! projs ) throw '`allProject` handler unsupported'
61
+ if ( projs . length === 0 ) throw 'no environment found'
62
+ return projs . map ( proj => {
61
63
proj . primary = proj . name
62
64
proj . secondary = proj . path
63
65
return proj
64
66
} )
65
67
} )
68
+ . then ( projs => {
69
+ show ( projs , { active : projectName } ) . then ( proj => {
70
+ if ( ! proj ) return
71
+ const dir = path . dirname ( proj . path )
72
+ activateProject ( dir )
73
+ } )
74
+ } )
66
75
. catch ( err => console . log ( err ) )
67
- show ( p , { active : projectName } ) . then ( proj => {
68
- if ( ! proj ) return
69
- const dir = path . dirname ( proj . path )
70
- activateProject ( dir )
71
- } )
72
76
} )
73
77
}
74
78
}
You can’t perform that action at this time.
0 commit comments