Fix all Promises with type <any> to type <void>
This commit is contained in:
parent
b90c7a4ebf
commit
b93dff4f1b
|
@ -11,7 +11,7 @@ export class ConfigurationService{
|
||||||
private communityInformation: BehaviorSubject<Portal> = new BehaviorSubject(null);
|
private communityInformation: BehaviorSubject<Portal> = new BehaviorSubject(null);
|
||||||
private sub: Subscription = null;
|
private sub: Subscription = null;
|
||||||
private source: Observable<Portal> = null;
|
private source: Observable<Portal> = null;
|
||||||
private promise: Promise<boolean> = null;
|
private promise: Promise<void> = null;
|
||||||
|
|
||||||
constructor(private http: HttpClient ) {}
|
constructor(private http: HttpClient ) {}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ export class ConfigurationService{
|
||||||
}
|
}
|
||||||
|
|
||||||
public initStaticCommunityInformation(communityInformation: Portal) {
|
public initStaticCommunityInformation(communityInformation: Portal) {
|
||||||
this.promise = new Promise<any>((resolve => {
|
this.promise = new Promise<void>((resolve => {
|
||||||
this.communityInformation.next(communityInformation);
|
this.communityInformation.next(communityInformation);
|
||||||
resolve();
|
resolve();
|
||||||
}));
|
}));
|
||||||
|
@ -44,7 +44,7 @@ export class ConfigurationService{
|
||||||
if(community == null) return;
|
if(community == null) return;
|
||||||
|
|
||||||
let url = properties.adminToolsAPIURL +"/" + properties.adminToolsPortalType + "/" + community + "/full";
|
let url = properties.adminToolsAPIURL +"/" + properties.adminToolsPortalType + "/" + community + "/full";
|
||||||
this.promise = new Promise<any>((resolve => {
|
this.promise = new Promise<void>((resolve => {
|
||||||
this.source = this.http.get<Portal>((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
|
this.source = this.http.get<Portal>((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url);
|
||||||
|
|
||||||
this.sub = this.source
|
this.sub = this.source
|
||||||
|
|
|
@ -91,7 +91,7 @@ export class ISVocabulariesService {
|
||||||
|
|
||||||
async getVocabularyFromServiceAsync(vocabularyName: string, properties: EnvProperties): Promise<AutoCompleteValue[]> {
|
async getVocabularyFromServiceAsync(vocabularyName: string, properties: EnvProperties): Promise<AutoCompleteValue[]> {
|
||||||
if(!this.vocabularies.has(vocabularyName)) {
|
if(!this.vocabularies.has(vocabularyName)) {
|
||||||
await new Promise<any>(resolve => {
|
await new Promise<void>(resolve => {
|
||||||
this.vocabularies.set(vocabularyName, new BehaviorSubject<any>(null));
|
this.vocabularies.set(vocabularyName, new BehaviorSubject<any>(null));
|
||||||
|
|
||||||
this.subscriptions.push(this.getVocabularyFromService(vocabularyName, properties).subscribe(
|
this.subscriptions.push(this.getVocabularyFromService(vocabularyName, properties).subscribe(
|
||||||
|
@ -201,7 +201,7 @@ export class ISVocabulariesService {
|
||||||
|
|
||||||
async getProvenanceActionVocabularyFromServiceAsync (vocabularyName: string, properties: EnvProperties): Promise<{}> {
|
async getProvenanceActionVocabularyFromServiceAsync (vocabularyName: string, properties: EnvProperties): Promise<{}> {
|
||||||
if(!this.provenanceActionVocabulary || !this.provenanceActionVocabulary.getValue()) {
|
if(!this.provenanceActionVocabulary || !this.provenanceActionVocabulary.getValue()) {
|
||||||
await new Promise<any>(resolve => {
|
await new Promise<void>(resolve => {
|
||||||
this.subscriptions.push(this.getProvenanceActionVocabularyFromService(vocabularyName, properties).subscribe(
|
this.subscriptions.push(this.getProvenanceActionVocabularyFromService(vocabularyName, properties).subscribe(
|
||||||
vocabularyRes => {
|
vocabularyRes => {
|
||||||
this.provenanceActionVocabulary.next(vocabularyRes);
|
this.provenanceActionVocabulary.next(vocabularyRes);
|
||||||
|
|
Loading…
Reference in New Issue