mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
save
This commit is contained in:
@@ -290,17 +290,17 @@ hideRefreshButton(){
|
||||
this.showLoader = true;
|
||||
this.result = this.chatService.getAllPrivateGroups().subscribe((res:any)=>{
|
||||
this.privateGroups = res.groups;
|
||||
this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
|
||||
this.publicGroups = res.channels;
|
||||
let all = this.privateGroups.concat(this.publicGroups);
|
||||
this.allGroups = all.sort((a,b)=>{
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
return dateB - dateA;
|
||||
});
|
||||
console.log(this.allGroups);
|
||||
this.showLoader = false;
|
||||
});
|
||||
/* this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
|
||||
this.publicGroups = res.channels; */
|
||||
//let all = this.privateGroups.concat(this.publicGroups);
|
||||
this.allGroups = this.privateGroups.sort((a,b)=>{
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
return dateB - dateA;
|
||||
});
|
||||
console.log(this.allGroups);
|
||||
this.showLoader = false;
|
||||
/* }); */
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import { ContactsPage } from '../new-group/contacts/contacts.page';
|
||||
import { NewGroupPage } from '../new-group/new-group.page';
|
||||
import { GroupContactsPage } from './group-contacts/group-contacts.page';
|
||||
import {Router} from '@angular/router'
|
||||
import { EditGroupPage } from '../edit-group/edit-group.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-group-messages',
|
||||
@@ -123,12 +124,12 @@ export class GroupMessagesPage implements OnInit, AfterViewChecked {
|
||||
});
|
||||
}
|
||||
//Otherwise call getChannelMembers for públic groups
|
||||
else{
|
||||
/* else{
|
||||
this.chatService.getPublicGroupMessages(this.roomId).subscribe(res=>{
|
||||
console.log(res);
|
||||
this.messages = res['messages'].reverse();
|
||||
});
|
||||
}
|
||||
} */
|
||||
}
|
||||
sendMessage(){
|
||||
let body = {
|
||||
@@ -161,7 +162,9 @@ export class GroupMessagesPage implements OnInit, AfterViewChecked {
|
||||
else if(res.data == 'cancel'){
|
||||
console.log('cancel');
|
||||
}
|
||||
console.log('OK2');
|
||||
else if(res.data == 'edit'){
|
||||
this.editGroup(this.roomId);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
@@ -200,6 +203,21 @@ export class GroupMessagesPage implements OnInit, AfterViewChecked {
|
||||
});
|
||||
}
|
||||
|
||||
async editGroup(roomId){
|
||||
const modal = await this.modalController.create({
|
||||
component: EditGroupPage,
|
||||
cssClass: 'modal modal-desktop',
|
||||
componentProps: {
|
||||
roomId: roomId,
|
||||
},
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((res)=>{
|
||||
console.log(res.data);
|
||||
this.modalController.dismiss(res.data);
|
||||
});
|
||||
}
|
||||
|
||||
/* async actionSheet() {
|
||||
const actionSheet = await this.actionSheetController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
|
||||
@@ -176,7 +176,7 @@ async openChatOptions(ev?: any) {
|
||||
if(this.route.url != "/home/chat"){
|
||||
console.log("Timer message stop")
|
||||
} else {
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await this.serverLongPull();
|
||||
console.log('Timer message running')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user