Fix all Promises with type <any> to type <void>

This commit is contained in:
Alex Martzios 2022-12-15 12:44:38 +02:00
parent b90c7a4ebf
commit b93dff4f1b
2 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,7 @@ export class ConfigurationService{
private communityInformation: BehaviorSubject<Portal> = new BehaviorSubject(null);
private sub: Subscription = null;
private source: Observable<Portal> = null;
private promise: Promise<boolean> = null;
private promise: Promise<void> = null;
constructor(private http: HttpClient ) {}
@ -35,7 +35,7 @@ export class ConfigurationService{
}
public initStaticCommunityInformation(communityInformation: Portal) {
this.promise = new Promise<any>((resolve => {
this.promise = new Promise<void>((resolve => {
this.communityInformation.next(communityInformation);
resolve();
}));
@ -44,7 +44,7 @@ export class ConfigurationService{
if(community == null) return;
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.sub = this.source

View File

@ -91,7 +91,7 @@ export class ISVocabulariesService {
async getVocabularyFromServiceAsync(vocabularyName: string, properties: EnvProperties): Promise<AutoCompleteValue[]> {
if(!this.vocabularies.has(vocabularyName)) {
await new Promise<any>(resolve => {
await new Promise<void>(resolve => {
this.vocabularies.set(vocabularyName, new BehaviorSubject<any>(null));
this.subscriptions.push(this.getVocabularyFromService(vocabularyName, properties).subscribe(
@ -201,7 +201,7 @@ export class ISVocabulariesService {
async getProvenanceActionVocabularyFromServiceAsync (vocabularyName: string, properties: EnvProperties): Promise<{}> {
if(!this.provenanceActionVocabulary || !this.provenanceActionVocabulary.getValue()) {
await new Promise<any>(resolve => {
await new Promise<void>(resolve => {
this.subscriptions.push(this.getProvenanceActionVocabularyFromService(vocabularyName, properties).subscribe(
vocabularyRes => {
this.provenanceActionVocabulary.next(vocabularyRes);