pull amde

This commit is contained in:
Equilibrium ITO
2024-03-11 11:24:01 +01:00
40 changed files with 449 additions and 324 deletions
+13
View File
@@ -32,6 +32,8 @@ import { EventTrigger } from 'src/app/services/eventTrigger.service';
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
import { RouteService } from 'src/app/services/route.service';
import { Plugins } from '@capacitor/core';
import { ChangeDetectorRef } from '@angular/core';
const { App } = Plugins;
@@ -128,6 +130,7 @@ export class ChatPage implements OnInit {
private RochetChatConnectorService: RochetChatConnectorService,
private zone: NgZone,
public RouteService: RouteService,
private ChangeDetectorRef: ChangeDetectorRef
) {
this.headers = new HttpHeaders();;
@@ -175,8 +178,18 @@ export class ChatPage implements OnInit {
}
});
this.ChatSystemService.setMainChangeDetector(()=> {
this.changeDetector()
})
}
changeDetector = () => {
console.log('run detection')
this.ChangeDetectorRef.detectChanges()
}
ngOnDestroy() {
// this.setStatus('offline');
this.routerSubscription?.unsubscribe();
@@ -1,6 +1,6 @@
<ion-header class="ion-no-border">
<ion-toolbar class="header-toolbar">
<div class="main-header">
<div class="main-header" *ngIf="ChatSystemService.getGroupRoom(roomId)">
<div class="header-top">
<!-- <app-btn-modal-dismiss></app-btn-modal-dismiss> -->
<div class="left">
@@ -45,7 +45,7 @@
</ion-header>
<ion-content>
<ion-content *ngIf="ChatSystemService.getGroupRoom(roomId)">
<div (click)="handleClick()" class="messages overflow-y-auto" #scrollMe>
<div class="welcome-text">
@@ -277,7 +277,7 @@
</ion-content>
<ion-footer>
<ion-footer *ngIf="ChatSystemService.getGroupRoom(roomId)">
<div class="typing" *ngIf="ChatSystemService.getGroupRoom(roomId).otherUserType == true">
<ngx-letters-avatar *ngIf="showAvatar" [avatarName]="ChatSystemService.getGroupRoom(roomId).name" [width]="30"
@@ -36,7 +36,6 @@ import { FileValidatorService } from "src/app/services/file/file-validator.servi
import { sanitize } from "sanitize-filename-ts";
import { FilePicker } from '@capawesome/capacitor-file-picker';
@Component({
selector: 'app-group-messages',
templateUrl: './group-messages.page.html',
@@ -109,7 +108,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
private file: File,
private fileOpener: FileOpener,
public RouteService: RouteService,
private FileValidatorService: FileValidatorService
private FileValidatorService: FileValidatorService,
private ChangeDetectorRef: ChangeDetectorRef
) {
this.ChatSystemService.getUser()
@@ -138,6 +138,8 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
open() {
try {
this.ChatSystemService.getGroupRoom(this.roomId).loadHistory({});
@@ -145,6 +147,9 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.ChatSystemService.openRoom(this.roomId)
this.groupNameFormart = this.ChatSystemService.getGroupRoom(this.roomId).name.split('-').join(' ')
this.ChatSystemService.getGroupRoom(this.roomId).setChangeDetector(()=> {
this.changeDetector()
})
} catch (error) {
setTimeout(() => {
this.open()
@@ -152,6 +157,12 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
}
changeDetector = () => {
console.log('run detection page')
this.ChangeDetectorRef.detectChanges()
}
ngOnInit() {
this.loggedUser = this.loggedUserChat;
+11 -2
View File
@@ -36,6 +36,7 @@ import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-co
import { FileValidatorService } from "src/app/services/file/file-validator.service"
import { sanitize } from "sanitize-filename-ts";
import { FilePicker } from '@capawesome/capacitor-file-picker';
import { ChangeDetectorRef } from '@angular/core';
@@ -122,7 +123,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
private fileOpener: FileOpener,
private router: Router,
public RochetChatConnectorService: RochetChatConnectorService,
private FileValidatorService: FileValidatorService
private FileValidatorService: FileValidatorService,
private ChangeDetectorRef: ChangeDetectorRef
) {
try {
@@ -141,6 +143,10 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.ChatSystemService.getDmRoom(this.roomId).loadHistory({})
this.ChatSystemService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
this.ChatSystemService.openRoom(this.roomId)
this.ChatSystemService.getDmRoom(this.roomId).setChangeDetector(()=> {
this.changeDetector()
})
setTimeout(() => {
this.scrollToBottomClicked()
@@ -148,8 +154,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} catch (error) {
//alert(error)
}
}
changeDetector = () => {
console.log('run detection page')
this.ChangeDetectorRef.detectChanges()
}
ngOnInit() {