fix: pass appInstance instead of appInstance.application

- Change window.Fleetbase = appInstance (not appInstance.application)
- Change setApplicationInstance(appInstance) (not appInstance.application)
- appInstance IS the ApplicationInstance, not the Application class
- Remove comment about RegistryService cascade
This commit is contained in:
roncodes
2025-12-02 21:07:27 -05:00
parent 7ae3ea95a2
commit 08dabaf138

View File

@@ -1,15 +1,14 @@
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
// Set window.Fleetbase to the application instance for global access
// This is used by services and engines to access the root application instance
if (typeof window !== 'undefined') {
window.Fleetbase = appInstance.application;
window.Fleetbase = appInstance;
}
// 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);
universeService.setApplicationInstance(appInstance);
}
}