Use of environment variables to set wait time for reading notifications and catch-up apis
This commit is contained in:
committed by
Adam Saghy
parent
240117c095
commit
0ca7d80df9
@@ -6,6 +6,7 @@ import { forkJoin } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { NotificationsService } from 'app/notifications/notifications.service';
|
||||
import { environment } from 'environments/environment';
|
||||
|
||||
/**
|
||||
* Notifications Tray Component
|
||||
@@ -17,7 +18,8 @@ import { NotificationsService } from 'app/notifications/notifications.service';
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class NotificationsTrayComponent implements OnInit, OnDestroy {
|
||||
|
||||
/** Wait time between API status calls 60 seg */
|
||||
waitTime = environment.waitTimeForNotifications || 60;
|
||||
/** Read Notifications */
|
||||
readNotifications: any[] = [];
|
||||
/** Displayed Read Notifications */
|
||||
@@ -57,7 +59,7 @@ export class NotificationsTrayComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
setTimeout(() => { this.fetchUnreadNotifications(); }, 60000);
|
||||
this.fetchUnreadNotifications();
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
@@ -81,7 +83,7 @@ export class NotificationsTrayComponent implements OnInit, OnDestroy {
|
||||
this.setNotifications();
|
||||
});
|
||||
// this.mockNotifications(); // Uncomment for Testing.
|
||||
this.timer = setTimeout(() => { this.fetchUnreadNotifications(); }, 60000);
|
||||
this.timer = setTimeout(() => { this.fetchUnreadNotifications(); }, this.waitTime * 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,11 +16,10 @@ export class TenantSelectorComponent implements OnInit {
|
||||
* Sets the Tenant Identifier of the application in the selector on initial setup.
|
||||
* @param {SettingsService} settingsService Settings Service.
|
||||
*/
|
||||
constructor(private settingsService: SettingsService) {
|
||||
this.tenantSelector.setValue(this.settingsService.tenantIdentifier);
|
||||
}
|
||||
constructor(private settingsService: SettingsService) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.tenantSelector.setValue(this.settingsService.tenantIdentifier);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user