mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
* refactor how we handle rpc responses and patchdb connection monitoring * websockets only * remove unused global error handlers * chore: clear storage inside auth service * feat: convert all global toasts to declarative approach (#1754) * no more reference to serverID Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: waterplea <alexander@inkin.ru>
28 lines
726 B
TypeScript
28 lines
726 B
TypeScript
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core'
|
|
import { Observable, Subject, merge } from 'rxjs'
|
|
|
|
import { NotificationsToastService } from './notifications-toast.service'
|
|
|
|
@Component({
|
|
selector: 'notifications-toast',
|
|
templateUrl: './notifications-toast.component.html',
|
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
})
|
|
export class NotificationsToastComponent {
|
|
private readonly dismiss$ = new Subject<boolean>()
|
|
|
|
readonly visible$: Observable<boolean> = merge(
|
|
this.dismiss$,
|
|
this.notifications$,
|
|
)
|
|
|
|
constructor(
|
|
@Inject(NotificationsToastService)
|
|
private readonly notifications$: Observable<boolean>,
|
|
) {}
|
|
|
|
onDismiss() {
|
|
this.dismiss$.next(false)
|
|
}
|
|
}
|