Skip to content

Commit 811779e

Browse files
committed
feat: #dev added blocking of duplicate same notification's message
1 parent 4718701 commit 811779e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/app/shared/services/notification.service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ export class NotificationService {
1616

1717
public addNotification(message: string, duration?: number): void {
1818
const notifications = this._notificationsSubject.getValue();
19+
20+
const existingNotification = notifications.find(
21+
notification => notification.message === message
22+
);
23+
24+
if (existingNotification) {
25+
return;
26+
}
27+
1928
const notification: INotification = {
2029
id: this._notificationIdCounter++,
2130
message,

0 commit comments

Comments
 (0)