This commit is contained in:
Peter Maquiran
2023-09-19 10:21:23 +01:00
parent 527cc0f2a6
commit f51bd246fc
29 changed files with 754 additions and 261 deletions
+14 -17
View File
@@ -41,25 +41,24 @@ export class NewGroupPage implements OnInit {
ngOnInit() {
// this.chatService.refreshtoken();
// console.log(this.documents)
}
_ionChange(event){
_ionChange(event) {
this.showDuration = event.detail.checked;
if(event.detail.checked){
if(event.detail.checked) {
this.thedate = new Date();
}
else{
else {
this.thedate = '';
}
}
close(){
close() {
this.modalController.dismiss();
}
async createGroup(){
let name = this.groupName.split(' ').join('-');
//Take out all special characters in string
name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
@@ -72,17 +71,15 @@ export class NewGroupPage implements OnInit {
"countDownDate": this.thedate
}
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
}
else{
res = await this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
}
this.isGroupCreated = true;
this.addContacts(res.result);
this.ChatSystemService.getAllRooms();
setTimeout(() => {
this.ChatSystemService.subscribeToRoomUpdate(res.result.rid, res.result);
}, 10)
@@ -90,23 +87,23 @@ export class NewGroupPage implements OnInit {
if(res?.result?.rid) {
this.ChatSystemService.getAllRooms(() => {
if(!this.ChatSystemService.getGroupRoom(res.result.rid)) {
this.createGroupWithAttachmentsCath(res)
} else {
setTimeout(()=> {
this.createGroupWithAttachments(res)
}, 500)
}
}, res.result.rid);
} else {
this.toastService._badRequest('Existe um grupo com este nome!');
}
@@ -169,7 +166,7 @@ export class NewGroupPage implements OnInit {
this.close();
let name = this.groupName.split(' ').join('-');
const modal = await this.modalController.create({
component: GroupContactsPage,
@@ -206,7 +203,7 @@ export class NewGroupPage implements OnInit {
text: 'Ok',
cssClass: 'btn-cancel',
handler:(value:any) => {
let now = new Date();
this.thedate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds());
@@ -215,7 +212,7 @@ export class NewGroupPage implements OnInit {
value.hours.value,
value.minutes.value,
]
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
if(value.days.value > 0) {
if(value.days.value == 1) {