mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
add and takepicture bug solved on group chat
This commit is contained in:
@@ -13,6 +13,7 @@ import { PublicationPipe } from 'src/app/pipes/publication.pipe';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { EditActionPage } from 'src/app/pages/publications/edit-action/edit-action.page';
|
||||
import { Storage } from '@ionic/storage';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -25,7 +26,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
publicationList: Publication[];
|
||||
item: PublicationFolder;
|
||||
|
||||
getpublication = [];
|
||||
error: any;
|
||||
|
||||
@Input() folderId: string;
|
||||
@@ -50,6 +51,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
private publications: PublicationsService,
|
||||
public ThemeService: ThemeService,
|
||||
private toastService: ToastService,
|
||||
private storage: Storage
|
||||
) {
|
||||
this.item = new PublicationFolder();
|
||||
}
|
||||
@@ -72,10 +74,10 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
console.log('change view to ',this.folderId)
|
||||
|
||||
setTimeout(()=>{
|
||||
//setTimeout(()=>{
|
||||
this.getPublications();
|
||||
this.getPublicationDetail();
|
||||
}, 100)
|
||||
//}, 100)
|
||||
|
||||
|
||||
}
|
||||
@@ -99,11 +101,58 @@ export class ViewPublicationsPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getPublicationsIds() {
|
||||
|
||||
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 = 0; i < res.length; i++) {
|
||||
this.publications.GetPublicationById(res[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)
|
||||
this.publications.GetPublicationById(element).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);
|
||||
})
|
||||
|
||||
}); */
|
||||
console.log('PUBLICATIONS IMAGEs',this.publicationList)
|
||||
this.storage.remove('view_publications');
|
||||
this.storage.set('view_publications', this.publicationList);
|
||||
console.log('PUBLICATIONS IMAGEs',this.publicationList)
|
||||
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
this.getpublication = this.publicationList;
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
this.storage.get('view_publications').then((viewPublications) => {
|
||||
this.getpublication = viewPublications;
|
||||
})
|
||||
}
|
||||
|
||||
getPublications() {
|
||||
this.showLoader = true;
|
||||
const folderId = this.folderId
|
||||
this.publicationList = new Array();
|
||||
this.publications.GetPublications(folderId).subscribe(res=> {
|
||||
this.getFromDB();
|
||||
this.publications.GetPublications(folderId).subscribe(async res=> {
|
||||
|
||||
res.forEach(element => {
|
||||
let item: Publication = this.publicationPipe.itemList(element)
|
||||
@@ -111,7 +160,9 @@ export class ViewPublicationsPage implements OnInit {
|
||||
});
|
||||
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
|
||||
await this.storage.remove('view_publications');
|
||||
await this.storage.set('view_publications', this.publicationList);
|
||||
//this.getFromDB();
|
||||
this.showLoader = false;
|
||||
},
|
||||
(error)=>{
|
||||
|
||||
Reference in New Issue
Block a user