MOBILE-3947 core: Fix null injection token
parent
76beb12d17
commit
48ebe85b51
|
@ -14,8 +14,15 @@
|
|||
|
||||
import envJson from '@/assets/env.json';
|
||||
import { EnvironmentConfig } from '@/types/config';
|
||||
import { InjectionToken } from '@angular/core';
|
||||
import { CoreBrowser } from '@singletons/browser';
|
||||
|
||||
/**
|
||||
* Injection token used for dependencies marked as optional that will never
|
||||
* be resolved by Angular injectors.
|
||||
*/
|
||||
export const NULL_INJECTION_TOKEN = new InjectionToken('null');
|
||||
|
||||
/**
|
||||
* Context levels enumeration.
|
||||
*/
|
||||
|
|
|
@ -24,6 +24,7 @@ import { SQLiteDB } from '@classes/sqlitedb';
|
|||
import { APP_SCHEMA, CoreStorageRecord, TABLE_NAME } from './database/storage';
|
||||
import { CoreSites } from './sites';
|
||||
import { CoreSite } from '@classes/sites/site';
|
||||
import { NULL_INJECTION_TOKEN } from '@/core/constants';
|
||||
|
||||
/**
|
||||
* Service to store data using key-value pairs.
|
||||
|
@ -38,7 +39,7 @@ export class CoreStorageService {
|
|||
|
||||
table: AsyncInstance<CoreStorageTable>;
|
||||
|
||||
constructor(@Optional() @Inject(null) lazyTableConstructor?: () => Promise<CoreStorageTable>) {
|
||||
constructor(@Optional() @Inject(NULL_INJECTION_TOKEN) lazyTableConstructor?: () => Promise<CoreStorageTable>) {
|
||||
this.table = asyncInstance(lazyTableConstructor);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue