@@ -25,6 +25,7 @@ import {
25
25
BoostHubSubscriptionDeleteEvent ,
26
26
boostHubSubscriptionDeleteEventEmitter ,
27
27
boostHubSubscriptionUpdateEventEmitter ,
28
+ boostHubCreateCloudSpaceEventEmitter ,
28
29
} from '../lib/events'
29
30
import { useRouteParams } from '../lib/routeParams'
30
31
import { useStorageRouter } from '../lib/storageRouter'
@@ -173,17 +174,6 @@ const App = () => {
173
174
} )
174
175
} )
175
176
176
- useEffect ( ( ) => {
177
- const createCloudSpaceHandler = ( ) => {
178
- push ( '/app/boosthub/teams' )
179
- }
180
- addIpcListener ( 'create-cloud-space' , createCloudSpaceHandler )
181
-
182
- return ( ) => {
183
- removeIpcListener ( 'create-cloud-space' , createCloudSpaceHandler )
184
- }
185
- } , [ push ] )
186
-
187
177
useEffect ( ( ) => {
188
178
const boostHubTeamCreateEventHandler = ( event : BoostHubTeamCreateEvent ) => {
189
179
const createdTeam = event . detail . team
@@ -305,6 +295,10 @@ const App = () => {
305
295
push ( `/app/storages` )
306
296
}
307
297
298
+ const boostHubCreateCloudSpaceEventHandler = ( ) => {
299
+ push ( '/app/boosthub/teams' )
300
+ }
301
+
308
302
boostHubSubscriptionDeleteEventEmitter . listen (
309
303
boostHubSubscriptionDeleteEventHandler
310
304
)
@@ -318,6 +312,9 @@ const App = () => {
318
312
boostHubCreateLocalSpaceEventEmitter . listen (
319
313
boostHubCreateLocalSpaceEventHandler
320
314
)
315
+ boostHubCreateCloudSpaceEventEmitter . listen (
316
+ boostHubCreateCloudSpaceEventHandler
317
+ )
321
318
return ( ) => {
322
319
boostHubSubscriptionDeleteEventEmitter . unlisten (
323
320
boostHubSubscriptionDeleteEventHandler
@@ -334,6 +331,9 @@ const App = () => {
334
331
boostHubCreateLocalSpaceEventEmitter . unlisten (
335
332
boostHubCreateLocalSpaceEventHandler
336
333
)
334
+ boostHubCreateCloudSpaceEventEmitter . unlisten (
335
+ boostHubCreateCloudSpaceEventHandler
336
+ )
337
337
}
338
338
} , [ push , setPreferences , setGeneralStatus ] )
339
339
const { boostHubTeams } = generalStatus
@@ -356,13 +356,25 @@ const App = () => {
356
356
} ,
357
357
[ storageMap , boostHubTeams , navigateToStorage , push ]
358
358
)
359
+
359
360
useEffect ( ( ) => {
360
361
addIpcListener ( 'switch-workspace' , switchWorkspaceHandler )
361
362
return ( ) => {
362
363
removeIpcListener ( 'switch-workspace' , switchWorkspaceHandler )
363
364
}
364
365
} , [ switchWorkspaceHandler ] )
365
366
367
+ useEffect ( ( ) => {
368
+ const createCloudSpaceHandler = ( ) => {
369
+ boostHubCreateCloudSpaceEventEmitter . dispatch ( )
370
+ }
371
+ addIpcListener ( 'create-cloud-space' , createCloudSpaceHandler )
372
+
373
+ return ( ) => {
374
+ removeIpcListener ( 'create-cloud-space' , createCloudSpaceHandler )
375
+ }
376
+ } , [ push ] )
377
+
366
378
useBoostNoteProtocol ( )
367
379
368
380
const { showingCloudIntroModal } = useCloudIntroModal ( )
0 commit comments