diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index f81eb7b19..0c1b04246 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -68,7 +68,7 @@ export class ViewPublicationsPage implements OnInit { if (typeof (this.folderId) == 'object') { this.folderId = this.folderId['ProcessId'] } - this.testForkJoin() + //this.testForkJoin() this.getPublicationDetail(); setTimeout(() => { this.getPublicationsIds(); @@ -76,7 +76,7 @@ export class ViewPublicationsPage implements OnInit { this.backgroundservice.registerBackService('Online', () => { this.getPublicationDetail(); - this.testForkJoin() + //this.testForkJoin() }) @@ -91,16 +91,16 @@ export class ViewPublicationsPage implements OnInit { // if (typeof (this.id == 'object') { // this.id = this.id['ProcessId'] // } - this.testForkJoin() + //this.testForkJoin() this.getPublicationDetail(); // this.getPublicationsIds(); } doRefresh = (event) => { setTimeout(() => { - this.testForkJoin() + //this.testForkJoin() this.getPublicationDetail(); - // this.getPublicationsIds(); + this.getPublicationsIds(); event.target.complete(); }, 3000); @@ -116,13 +116,13 @@ export class ViewPublicationsPage implements OnInit { } getPublicationDetail() { - this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{ + this.publications.GetPresidentialAction(this.folderId).subscribe(res => { console.log(res); this.item = res; }); } -// goes to fork + // goes to fork // getPublicationsIds() { // this.showLoader = true; @@ -138,20 +138,20 @@ export class ViewPublicationsPage implements OnInit { this.showLoader = true; const folderId = this.folderId - + this.getFromDB() this.publications.GetPublicationsImages(this.folderId).subscribe(res => { console.log('publications ids', res) this.publicationList = new Array(); - /* for(let i of res) { - this.publications.GetPublicationById(i).subscribe(ress => { - console.log('publications by ids', ress) - let item: Publication = this.publicationPipe.itemList(ress) - console.log('publications by ids 2', item) - this.publicationList.push(item); - }) - } */ + /* for(let i of res) { + this.publications.GetPublicationById(i).subscribe(ress => { + console.log('publications by ids', ress) + let item: Publication = this.publicationPipe.itemList(ress) + console.log('publications by ids 2', item) + this.publicationList.push(item); + }) + } */ res.forEach(element => { console.log('publications elements', element) @@ -168,7 +168,6 @@ export class ViewPublicationsPage implements OnInit { this.publicationListStorage.add(folderId, this.publicationList) this.getpublication = this.publicationList; - this.showLoader = false; /* this.publicationList = new Array(); @@ -189,7 +188,7 @@ export class ViewPublicationsPage implements OnInit { this.showLoader = true; const folderId = this.folderId - + this.getFromDB(); this.publications.GetPublications(this.folderId).subscribe(res => { console.log(this.folderId) @@ -223,13 +222,13 @@ export class ViewPublicationsPage implements OnInit { }); } - testForkJoin(){ + testForkJoin() { forkJoin([ this.getPublicationsIds(), this.getPublications(), - ]).subscribe(allResults =>{ + ]).subscribe(allResults => { this.publicationList = allResults[2] }) } diff --git a/src/app/services/chat/ws-chat-methods.service.ts b/src/app/services/chat/ws-chat-methods.service.ts index 0cfbf8608..6cc607027 100644 --- a/src/app/services/chat/ws-chat-methods.service.ts +++ b/src/app/services/chat/ws-chat-methods.service.ts @@ -40,11 +40,21 @@ export class WsChatMethodsService { } + getRoomFromDb() { + this.storage.get('Rooms').then((rooms) => { + rooms.result.update.forEach((roomData: room) => { + this.prepareRoom(roomData); + }); + }) + }; + async getAllRooms () { this.loadingWholeList = true - + this.getRoomFromDb(); const rooms = await this.WsChatService.getRooms(); + this.storage.set('Rooms', rooms); + // console.log("ROOMS" + JSON.stringify(rooms)) rooms.result.update.forEach((roomData: room) => { diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts index 42f4c4c87..ce95737f1 100644 --- a/src/app/shared/shared.module.ts +++ b/src/app/shared/shared.module.ts @@ -2,6 +2,7 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { IonicModule } from '@ionic/angular'; +import { IonicImageLoaderModule } from 'ionic-image-loader-v5'; // import { HeaderPage } from './header/header.page'; // import { HeaderPrPage } from './header-pr/header-pr.page'; // import { BtnSeguintePage } from './btn-seguinte/btn-seguinte.page'; @@ -17,7 +18,8 @@ import { IonicModule } from '@ionic/angular'; imports: [ CommonModule, FormsModule, - IonicModule + IonicModule, + IonicImageLoaderModule ], exports: [ // HeaderPage,