WebAPI: layer type

This commit is contained in:
2023-07-04 20:07:46 +02:00
parent 58917f97e4
commit 0b5947dda5
6 changed files with 435 additions and 201 deletions

View File

@@ -9,13 +9,13 @@ import moment, { Moment } from 'moment';
})
export class NotificationsService {
public messages: Message[] = [];
public messages: IMessage[] = [];
private handler?: MatBottomSheetRef;
constructor(
private bottomSheet$: MatBottomSheet
) { }
public add(message: Message): string {
public add(message: IMessage): string {
message.id = uuidv4();
message.createdAt = moment();
this.messages.push(message);
@@ -55,13 +55,13 @@ export class NotificationsService {
return a.createdAt && a.createdAt.isAfter(b.createdAt) ? 1 : -1;
})
}
doAction(message: Message) {
doAction(message: IMessage) {
if (message.action) { message.action(); }
this.remove(message.id, false);
}
}
interface Message {
interface IMessage {
id?: string;
text: string;
duration?: number;