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