mirror of
https://github.com/fleetbase/fleetbase.git
synced 2025-12-19 14:18:57 +00:00
feat: add set-application-instance initializer to console
- Create app/instance-initializers/set-application-instance.js - Sets window.Fleetbase = appInstance.application for global access - Calls universeService.setApplicationInstance() to cascade to RegistryService - Ensures all services have access to root application container - Required for UniverseRegistry singleton to work across engines
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
export function initialize(appInstance) {
|
||||
// Set window.Fleetbase to the application for global access
|
||||
// This is used by services and engines to access the root application
|
||||
if (typeof window !== 'undefined') {
|
||||
window.Fleetbase = appInstance.application;
|
||||
}
|
||||
|
||||
// Look up UniverseService and set the application instance
|
||||
// This cascades to RegistryService automatically via universe.setApplicationInstance()
|
||||
const universeService = appInstance.lookup('service:universe');
|
||||
if (universeService) {
|
||||
universeService.setApplicationInstance(appInstance.application);
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
initialize
|
||||
};
|
||||
Reference in New Issue
Block a user