@@ -82,21 +82,16 @@ export default class RegistryService extends Service {
8282 let application = this . applicationInstance ;
8383
8484 if ( ! application ) {
85- // Second priority: window.Fleetbase
86- if ( typeof window !== 'undefined' && window . Fleetbase ) {
87- application = window . Fleetbase ;
85+ // Second priority: try to get from owner
86+ const owner = getOwner ( this ) ;
87+ if ( owner && owner . application ) {
88+ application = owner . application ;
8889 } else {
89- // Third priority: try to get from owner
90- const owner = getOwner ( this ) ;
91- if ( owner && owner . application ) {
92- application = owner . application ;
93- } else {
94- warn ( '[RegistryService] Could not find application instance for registry initialization' , {
95- id : 'registry-service.no-application' ,
96- } ) ;
97- // Return a new instance as fallback (won't be shared)
98- return new UniverseRegistry ( ) ;
99- }
90+ warn ( '[RegistryService] Could not find application instance for registry initialization' , {
91+ id : 'registry-service.no-application' ,
92+ } ) ;
93+ // Return a new instance as fallback (won't be shared)
94+ return new UniverseRegistry ( ) ;
10095 }
10196 }
10297
@@ -489,7 +484,7 @@ export default class RegistryService extends Service {
489484 * );
490485 */
491486 async registerHelper ( helperName , helperClassOrTemplateHelper , options = { } ) {
492- const owner = this . applicationInstance || ( typeof window !== 'undefined' && window . Fleetbase ) || getOwner ( this ) ;
487+ const owner = this . applicationInstance || getOwner ( this ) ;
493488
494489 if ( ! owner ) {
495490 warn ( 'No owner available for helper registration. Cannot register helper.' , {
@@ -539,7 +534,7 @@ export default class RegistryService extends Service {
539534 * @returns {Promise<Function|Class|null> } The loaded helper or null if failed
540535 */
541536 async #loadHelperFromEngine( templateHelper ) {
542- const owner = this . applicationInstance || ( typeof window !== 'undefined' && window . Fleetbase ) || getOwner ( this ) ;
537+ const owner = this . applicationInstance || getOwner ( this ) ;
543538
544539 if ( ! owner ) {
545540 return null ;
0 commit comments