This commit is contained in:
Peter Maquiran
2022-05-27 13:36:37 +01:00
parent 304975d823
commit ce7cee0876
25 changed files with 131 additions and 234 deletions
+13 -13
View File
@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular';
import { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page';
import { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page';
import { ThemeService } from 'src/app/services/theme.service'
import { ThemeService } from 'src/app/services/theme.service';
import { ChatService } from 'src/app/services/chat.service';
import { ProcessesService } from 'src/app/services/processes.service';
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
@@ -35,8 +35,7 @@ export class NewGroupPage implements OnInit {
private processesService: ProcessesService,
public wsChatMethodsService: WsChatMethodsService,
private authService: AuthService,
)
{
) {
this.loggedUserChat = authService.ValidatedUserChat['data'];
this.isGroupCreated = false;
this.groupName = this.navParams.get('name');
@@ -71,9 +70,9 @@ export class NewGroupPage implements OnInit {
let customFields = {}
let res:any;
if(this.thedate){
if(this.thedate) {
let customFields = {
"countDownDate":this.thedate
"countDownDate": this.thedate
}
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
@@ -85,13 +84,14 @@ export class NewGroupPage implements OnInit {
this.isGroupCreated = true;
this.addContacts(res.result);
this.wsChatMethodsService.subscribeToRoomUpdate(res.result.rid, res.result);
console.log(res.result.rid)
setTimeout(() => {
this.wsChatMethodsService.subscribeToRoomUpdate(res.result.rid, res.result);
}, 10)
}
async addContacts(room){
async addContacts(room) {
this.close();
let name = this.groupName.split(' ').join('-');
@@ -130,7 +130,7 @@ export class NewGroupPage implements OnInit {
{
text: 'Ok',
cssClass: 'btn-cancel',
handler:(value:any)=>{
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());
@@ -142,9 +142,9 @@ export class NewGroupPage implements OnInit {
]
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
if(value.days.value > 0){
if(value.days.value == 1){
if(value.hours.value == 1){
if(value.days.value > 0) {
if(value.days.value == 1) {
if(value.hours.value == 1) {
this.displayDuration = value.days.value + " day " +
value.hours.value + " hora " +
value.minutes.value + " minutos";