I have data that is updated every five minutes and if new records appear, a notification pops up.
Is it possible to somehow make the notification appear regardless of which browser tab the person is on?
loadInfo(): void {
timer(0, 300000).pipe(
switchMap(() => this.letterService.getIsNew())
).
pipe(takeUntil(this.destroy$))
.subscribe(
(data) => {
data.filter(req => {
this.toastr.info(`New request #${req.number}`, 'Attention!', {
closeButton: true,
disableTimeOut: true
});
this.letterService.isNewFalse(req.id).subscribe(
() => { },
error => {
this.toastr.error(error.error.message);
}
)
})
})
}