@@ -30,7 +30,7 @@ export class Topbar extends Plugin {
30
30
dispatch : React . Dispatch < any > = ( ) => { }
31
31
appStateDispatch : React . Dispatch < AppAction > = ( ) => { }
32
32
htmlElement : HTMLDivElement
33
- events : EventEmitter
33
+ event : EventEmitter
34
34
topbarExpandPath : string
35
35
filePanel : FilePanel
36
36
git : GitPlugin
@@ -44,6 +44,7 @@ export class Topbar extends Plugin {
44
44
super ( TopBarProfile )
45
45
this . filePanel = filePanel
46
46
this . registry = Registry . getInstance ( )
47
+ this . event = new EventEmitter ( )
47
48
this . fileProviders = this . registry . get ( 'fileproviders' ) . api
48
49
this . fileManager = this . registry . get ( 'filemanager' ) . api
49
50
this . git = git
@@ -52,6 +53,12 @@ export class Topbar extends Plugin {
52
53
}
53
54
54
55
onActivation ( ) : void {
56
+ this . on ( 'pinnedPanel' , 'pluginClosed' , ( profile ) => {
57
+ this . event . emit ( 'pluginIsClosed' , profile )
58
+ } )
59
+ this . on ( 'pinnedPanel' , 'pluginMaximized' , ( profile ) => {
60
+ this . event . emit ( 'pluginIsMaximized' , profile )
61
+ } )
55
62
this . renderComponent ( )
56
63
}
57
64
@@ -69,12 +76,6 @@ export class Topbar extends Plugin {
69
76
}
70
77
71
78
async createWorkspace ( workspaceName , workspaceTemplateName , isEmpty ) {
72
- // return new Promise((resolve, reject) => {
73
- // this.emit('createWorkspaceReducerEvent', workspaceName, workspaceTemplateName, isEmpty, (err, data) => {
74
- // if (err) reject(err)
75
- // else resolve(data || true)
76
- // })
77
- // })
78
79
try {
79
80
await createWorkspace ( workspaceName , workspaceTemplateName , isEmpty )
80
81
this . emit ( 'workspaceCreated' , workspaceName , workspaceTemplateName , isEmpty )
@@ -84,12 +85,6 @@ export class Topbar extends Plugin {
84
85
}
85
86
86
87
async renameWorkspace ( oldName , workspaceName ) {
87
- // return new Promise((resolve, reject) => {
88
- // this.emit('renameWorkspaceReducerEvent', oldName, workspaceName, (err, data) => {
89
- // if (err) reject(err)
90
- // else resolve(data || true)
91
- // })
92
- // })
93
88
try {
94
89
await renameWorkspace ( oldName , workspaceName )
95
90
this . emit ( 'workspaceRenamed' , oldName , workspaceName )
@@ -99,12 +94,6 @@ export class Topbar extends Plugin {
99
94
}
100
95
101
96
async deleteWorkspace ( workspaceName ) {
102
- // return new Promise((resolve, reject) => {
103
- // this.emit('deleteWorkspaceReducerEvent', workspaceName, (err, data) => {
104
- // if (err) reject(err)
105
- // else resolve(data || true)
106
- // })
107
- // })
108
97
try {
109
98
await deleteWorkspace ( workspaceName )
110
99
this . emit ( 'workspaceDeleted' , workspaceName )
0 commit comments