mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
improve chat
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div class="main-header">
|
||||
<div class="header-top">
|
||||
<div class="middle" *ngFor="let users of dmUsers">
|
||||
<ion-label class="title">{{users.name}}</ion-label>
|
||||
<ion-label class="title">{{ wsChatService.getRoom(roomId).name }}</ion-label>
|
||||
<span><ion-icon class="{{users.status}}" name="ellipse"></ion-icon></span>
|
||||
</div>
|
||||
<div hidden class="right">
|
||||
@@ -37,7 +37,7 @@
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="messages" #scrollMe>
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of ChatServiceGPR.getRoom(roomId).massages; let last = last">
|
||||
<div class="messages-list-item-wrapper container-width-100" *ngFor="let msg of wsChatService.getRoom(roomId).massages; let last = last">
|
||||
<div class='message-item incoming-{{msg.u.username!=loggedUser.me.username}} max-width-45' *ngIf="msg.msg !=''">
|
||||
<div class="message-item-options d-flex justify-content-end">
|
||||
<fa-icon [matMenuTriggerFor]="beforeMenu" icon="chevron-down" class="message-options-icon cursor-pointer"></fa-icon>
|
||||
|
||||
@@ -19,7 +19,7 @@ import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { PreviewCameraPage } from 'src/app/modals/preview-camera/preview-camera.page';
|
||||
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||
import { ChatService as ChatServiceGPR} from 'src/app/services/chat/chat.service'
|
||||
import { wsChatService as wsChatService} from 'src/app/services/chat/chat.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-messages',
|
||||
@@ -78,13 +78,13 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
public ThemeService: ThemeService,
|
||||
private changeDetectorRef: ChangeDetectorRef,
|
||||
private router: Router,
|
||||
public ChatServiceGPR: ChatServiceGPR
|
||||
public wsChatService: wsChatService
|
||||
) {
|
||||
|
||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||
}
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
this.ChatServiceGPR.getRoom(this.roomId).loadHistory()
|
||||
this.wsChatService.getRoom(this.roomId).loadHistory()
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -214,7 +214,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
}
|
||||
|
||||
sendMessage() {
|
||||
this.ChatServiceGPR.getRoom(this.roomId).send(this.message)
|
||||
this.wsChatService.getRoom(this.roomId).send(this.message)
|
||||
this.message = "";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user