improve chat

This commit is contained in:
Peter Maquiran
2022-01-12 11:52:05 +01:00
parent b8b4ba6a05
commit 5552aa484b
13 changed files with 46 additions and 44 deletions
@@ -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 = "";
}