add message notification

This commit is contained in:
Peter Maquiran
2022-01-13 10:19:14 +01:00
parent 361e60a797
commit 9bb9516491
2 changed files with 8 additions and 4 deletions
+4 -1
View File
@@ -3,6 +3,8 @@ import { WsChatService } from 'src/app/services/chat/ws-chat.service';
import { MessageService } from 'src/app/services/chat/message.service'
import { ChatUserService } from 'src/app/services/chat/chat-user.service'
import { showDateDuration } from 'src/plugin/showDateDuration'
import { ToastsService } from '../toast.service';
@Injectable({
providedIn: 'root'
})
@@ -18,6 +20,7 @@ export class RoomService {
private hasLoadHistory = false
duration = ''
ToastService = ToastsService
constructor(
public WsChatService: WsChatService,
@@ -43,7 +46,7 @@ export class RoomService {
message.setData(Chatmessage.result)
this.massages.push(message)
this.calDateDuration(Chatmessage.result._updatedAt)
this.ToastService.presentToast('nova mensagem')
}
)
}
+4 -3
View File
@@ -10,9 +10,7 @@ export class ToastService {
constructor(
public toastController: ToastController,
private animationController: AnimationController,
private modalController: ModalController,
) { }
) { }
ngOnInit() {}
@@ -230,3 +228,6 @@ export class ToastService {
}
}
export const ToastsService = new ToastService(new ToastController())