mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
@@ -570,7 +570,11 @@ export class RoomService {
|
|||||||
this.messagesLocalReference.push(localReference)
|
this.messagesLocalReference.push(localReference)
|
||||||
const message: MessageService = await this.prepareCreate({message:offlineChatMessage, save: environment.chatOffline})
|
const message: MessageService = await this.prepareCreate({message:offlineChatMessage, save: environment.chatOffline})
|
||||||
|
|
||||||
|
if(this.hasLoadHistory == true) {
|
||||||
|
alert("save send")
|
||||||
await message.addMessageDB()
|
await message.addMessageDB()
|
||||||
|
}
|
||||||
|
|
||||||
message.send()
|
message.send()
|
||||||
|
|
||||||
|
|
||||||
@@ -757,11 +761,20 @@ export class RoomService {
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.hasLoadHistoryMessageRF = [];
|
for(let message of reorderMessage) {
|
||||||
|
|
||||||
reorderMessage.forEach((message) => {
|
|
||||||
this.messages.push(message)
|
this.messages.push(message)
|
||||||
});
|
}
|
||||||
|
|
||||||
|
for(let message of this.messages) {
|
||||||
|
if(this.hasLoadHistoryMessageRF.includes(message?.localReference)) {
|
||||||
|
if(!message.addToDb) {
|
||||||
|
message.addMessageDB()
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.hasLoadHistoryMessageRF = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="header-top">
|
<div class="header-top">
|
||||||
<div class="middle">
|
<div class="middle">
|
||||||
<ion-label class="title">{{ this.wsChatMethodsService.getDmRoom(this.roomId).name }}</ion-label>
|
<ion-label class="title">{{ this.wsChatMethodsService.getDmRoom(this.roomId).name }}</ion-label>
|
||||||
<button>Dev</button>
|
<!-- <button (click)="ChatMessageDebuggingPage()">Dev</button> -->
|
||||||
<!-- <span><ion-icon class="{{users.status}}" name="ellipse"></ion-icon></span> -->
|
<!-- <span><ion-icon class="{{users.status}}" name="ellipse"></ion-icon></span> -->
|
||||||
</div>
|
</div>
|
||||||
<div hidden class="right">
|
<div hidden class="right">
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import { SessionStore } from 'src/app/store/session.service';
|
|||||||
import { Howl } from 'howler';
|
import { Howl } from 'howler';
|
||||||
import { runInThisContext } from 'vm';
|
import { runInThisContext } from 'vm';
|
||||||
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
import { ViewMediaPage } from 'src/app/modals/view-media/view-media.page';
|
||||||
|
import { ChatMessageDebuggingPage } from 'src/app/shared/popover/chat-message-debugging/chat-message-debugging.page';
|
||||||
|
|
||||||
|
|
||||||
const IMAGE_DIR = 'stored-images';
|
const IMAGE_DIR = 'stored-images';
|
||||||
@@ -151,6 +152,18 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async ChatMessageDebuggingPage() {
|
||||||
|
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: ChatMessageDebuggingPage,
|
||||||
|
cssClass: 'model profile-modal search-submodal',
|
||||||
|
componentProps: {
|
||||||
|
roomId: this.roomId,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return await modal.present();
|
||||||
|
}
|
||||||
|
|
||||||
async checkAudioPermission() {
|
async checkAudioPermission() {
|
||||||
const permissionStatus = await navigator.permissions.query({ name: 'microphone' } as any)
|
const permissionStatus = await navigator.permissions.query({ name: 'microphone' } as any)
|
||||||
|
|
||||||
@@ -1121,7 +1134,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getRoomInfo() {
|
async getRoomInfo() {
|
||||||
this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
|
// this.wsChatMethodsService.getGroupRoom(this.roomId).loadHistory({});
|
||||||
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
|
let room = await this.chatService.getRoomInfo(this.roomId).toPromise();
|
||||||
// console.log('ROOM',room)
|
// console.log('ROOM',room)
|
||||||
this.room = room['room'];
|
this.room = room['room'];
|
||||||
|
|||||||
@@ -5,5 +5,6 @@
|
|||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
|
<button (click)="loadHistory()">Load History</button>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { NavParams } from '@ionic/angular';
|
||||||
import { WsChatMethodsService} from 'src/app/services/chat/ws-chat-methods.service';
|
import { WsChatMethodsService} from 'src/app/services/chat/ws-chat-methods.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -8,11 +9,21 @@ import { WsChatMethodsService} from 'src/app/services/chat/ws-chat-methods.servi
|
|||||||
})
|
})
|
||||||
export class ChatMessageDebuggingPage implements OnInit {
|
export class ChatMessageDebuggingPage implements OnInit {
|
||||||
|
|
||||||
|
roomId: string
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public wsChatMethodsService: WsChatMethodsService
|
public wsChatMethodsService: WsChatMethodsService,
|
||||||
|
private navParams: NavParams
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
this.roomId = this.navParams.get('roomId')
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
loadHistory() {
|
||||||
|
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user