mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -143,14 +143,18 @@ export class ChatPage implements OnInit {
|
||||
hideRefreshButton(){
|
||||
window.onresize = (event) => {
|
||||
if( window.innerWidth < 701) {
|
||||
this.idSelected = '';
|
||||
this.hideRefreshBtn = false;
|
||||
}
|
||||
else{
|
||||
this.hideRefreshBtn = true;
|
||||
if(this.idSelected == ''){
|
||||
this.showEmptyComponent=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(window.innerWidth < 701){
|
||||
console.log('YASS');
|
||||
this.idSelected = '';
|
||||
this.hideRefreshBtn = false;
|
||||
}
|
||||
}
|
||||
@@ -184,9 +188,11 @@ hideRefreshButton(){
|
||||
}
|
||||
|
||||
showEmptyContainer(){
|
||||
this.idSelected = '';
|
||||
this.showEmptyComponent=true;
|
||||
}
|
||||
openGroupContactsPage(data){
|
||||
this.idSelected = '';
|
||||
this.groupRoomId = data;
|
||||
this.closeAllDesktopComponents();
|
||||
if(window.innerWidth < 801){
|
||||
@@ -197,12 +203,12 @@ hideRefreshButton(){
|
||||
}
|
||||
}
|
||||
openMessagesPage(rid) {
|
||||
this.idSelected = rid;
|
||||
if( window.innerWidth < 701){
|
||||
this.openMessagesModal(rid);
|
||||
//this.router.navigate(['/home/chat/messages',rid,]);
|
||||
}
|
||||
else{
|
||||
this.idSelected = rid;
|
||||
this.closeAllDesktopComponents();
|
||||
this.showEmptyComponent = false;
|
||||
this.roomId = rid;
|
||||
@@ -211,6 +217,7 @@ hideRefreshButton(){
|
||||
}
|
||||
openContactsPage() {
|
||||
console.log('OK');
|
||||
this.idSelected = '';
|
||||
this.closeAllDesktopComponents();
|
||||
|
||||
if( window.innerWidth < 701){
|
||||
@@ -222,6 +229,7 @@ hideRefreshButton(){
|
||||
}
|
||||
}
|
||||
openNewGroupPage() {
|
||||
this.idSelected = '';
|
||||
if( window.innerWidth < 801){
|
||||
this.newGroup();
|
||||
}
|
||||
@@ -242,13 +250,13 @@ hideRefreshButton(){
|
||||
}
|
||||
|
||||
openGroupMessagesPage(rid) {
|
||||
this.idSelected = rid;
|
||||
console.log(rid);
|
||||
|
||||
if( window.innerWidth < 701){
|
||||
this.openGroupMessagesModal(rid);
|
||||
}
|
||||
else{
|
||||
this.idSelected = rid;
|
||||
this.closeAllDesktopComponents();
|
||||
this.showEmptyComponent = false;
|
||||
this.roomId = rid;
|
||||
@@ -427,7 +435,7 @@ hideRefreshButton(){
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: MessagesPage,
|
||||
cssClass: 'modal modal-desktop messagesChatOpened',
|
||||
cssClass: 'modal modal-desktop isMessagesChatOpened',
|
||||
componentProps: {
|
||||
roomId: roomId,
|
||||
},
|
||||
@@ -442,7 +450,7 @@ hideRefreshButton(){
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: GroupMessagesPage,
|
||||
cssClass: 'modal modal-desktop groupChatOpened',
|
||||
cssClass: 'modal modal-desktop isGroupChatOpened',
|
||||
componentProps: {
|
||||
roomId: roomId,
|
||||
},
|
||||
|
||||
@@ -268,8 +268,8 @@ export class GroupMessagesPage implements OnInit, AfterViewChecked {
|
||||
console.log("Timer message stop")
|
||||
} else {
|
||||
//Check if modal is opened
|
||||
if(document.querySelector('.groupChatOpened')){
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
if(document.querySelector('.isGroupChatOpened')){
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
await this.serverLongPull();
|
||||
console.log('Timer message running')
|
||||
}
|
||||
|
||||
@@ -188,8 +188,8 @@ export class MessagesPage implements OnInit, AfterViewChecked {
|
||||
console.log("Timer message stop")
|
||||
} else {
|
||||
//Check if modal is opened
|
||||
if(document.querySelector('.messagesChatOpened')){
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
if(document.querySelector('.isMessagesChatOpened')){
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
await this.serverLongPull();
|
||||
console.log('Timer message running')
|
||||
}
|
||||
|
||||
@@ -413,9 +413,14 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewChecked {
|
||||
if(this.route.url != "/home/chat"){
|
||||
console.log("Timer message stop")
|
||||
} else {
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await this.serverLongPull();
|
||||
console.log('Timer message running')
|
||||
if(document.querySelector('app-group-messages')){
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
await this.serverLongPull();
|
||||
console.log('Timer message running')
|
||||
}
|
||||
else{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -35,7 +35,7 @@ export class MessagesPage implements OnInit, AfterViewChecked, OnChanges {
|
||||
|
||||
|
||||
connection = connection
|
||||
|
||||
|
||||
constructor(
|
||||
public popoverController: PopoverController,
|
||||
private modalController: ModalController,
|
||||
@@ -303,11 +303,12 @@ export class MessagesPage implements OnInit, AfterViewChecked, OnChanges {
|
||||
if(this.route.url != "/home/chat"){
|
||||
console.log("Timer message stop")
|
||||
} else {
|
||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await this.serverLongPull();
|
||||
console.log('Timer message running')
|
||||
if(document.querySelector('app-messages')){
|
||||
await new Promise(resolve => setTimeout(resolve, 5000));
|
||||
await this.serverLongPull();
|
||||
console.log('Timer message running')
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// Got message
|
||||
//let message = await response.text();
|
||||
|
||||
Reference in New Issue
Block a user