mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
Bug fix presenting photo when take picture is perform
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
<ion-item lines="none">
|
||||
<ion-thumbnail slot="start">
|
||||
|
||||
<ion-img [(ngModel)]="capturedImage" name="image" ngDefaultControl [src]="photo" (click)="openPreview(photo)" ></ion-img>
|
||||
<ion-img [(ngModel)]="capturedImage" name="image" ngDefaultControl [src]="capturedImage" ></ion-img>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<img src="" #imageElement/>
|
||||
|
||||
@@ -404,7 +404,8 @@ export class NewPublicationPage implements OnInit {
|
||||
directory: Directory.Data
|
||||
});
|
||||
|
||||
this.loadFiles();
|
||||
//this.loadFiles(fileName);
|
||||
this.loadFileData(fileName);
|
||||
}
|
||||
|
||||
private async readAsBase64(photo: Photo) {
|
||||
@@ -424,7 +425,7 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
async loadFiles() {
|
||||
async loadFiles(fileName) {
|
||||
this.images = [];
|
||||
|
||||
const loading = await this.loadingCtrl.create({
|
||||
@@ -432,11 +433,11 @@ export class NewPublicationPage implements OnInit {
|
||||
});
|
||||
await loading.present();
|
||||
|
||||
Filesystem.readdir({
|
||||
path: IMAGE_DIR,
|
||||
/* Filesystem.readdir({
|
||||
path: `${IMAGE_DIR}/${fileName}`,
|
||||
directory: Directory.Data,
|
||||
}).then(result => {
|
||||
console.log('ALL RESULTS', result.files[0])
|
||||
console.log('ALL RESULTS', result.files)
|
||||
let lastphoto = result.files[result.files.length - 1]
|
||||
this.loadFileData(lastphoto);
|
||||
},
|
||||
@@ -451,12 +452,17 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
).then(_ => {
|
||||
loading.dismiss();
|
||||
});
|
||||
}); */
|
||||
}
|
||||
|
||||
async loadFileData(fileName: string) {
|
||||
console.log('ALL PHOTOT FILE', fileName)
|
||||
// for (let f of fileNames) {
|
||||
|
||||
const loading = await this.loadingCtrl.create({
|
||||
message: 'Loading data...',
|
||||
});
|
||||
await loading.present();
|
||||
|
||||
const filePath = `${IMAGE_DIR}/${fileName}`;
|
||||
|
||||
const readFile = await Filesystem.readFile({
|
||||
@@ -473,6 +479,8 @@ export class NewPublicationPage implements OnInit {
|
||||
console.log('ALL IMAGE', this.images)
|
||||
|
||||
this.capturedImage = this.images[0].data
|
||||
//}
|
||||
|
||||
loading.dismiss();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user