diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts
index fe9565729..5eb6b7c7d 100644
--- a/src/app/pages/publications/new-publication/new-publication.page.ts
+++ b/src/app/pages/publications/new-publication/new-publication.page.ts
@@ -19,7 +19,6 @@ import { ThemeService } from 'src/app/services/theme.service';
import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera';
import { Filesystem, Directory } from '@capacitor/filesystem';
-import { Photos } from './photos';
const IMAGE_DIR = 'stored-images';
@@ -71,11 +70,7 @@ export class NewPublicationPage implements OnInit {
capturedImage: any = '';
capturedImageTitle: any;
- // public photos: any[] = [];
-
- public photos: Photos[] = [];
- private PHOTO_STORAGE: string = "photos";
- private platform: Platform;
+ public photos: any[] = [];
constructor(
private modalController: ModalController,
@@ -86,7 +81,7 @@ export class NewPublicationPage implements OnInit {
private fileLoaderService: FileLoaderService,
private fileToBase64Service: FileToBase64Service,
public ThemeService: ThemeService,
- // private platform: Platform,
+ private platform: Platform,
private loadingCtrl: LoadingController,
) {
@@ -118,104 +113,17 @@ export class NewPublicationPage implements OnInit {
if (image) {
this.saveImage(image)
}
+
}
-
- // Little helper
- // async presentToast(text) {
- // const toast = await this.toastCtrl.create({
- // message: text,
- // duration: 3000,
- // });
- // toast.present();
- // }
-
-// async selectImage() {
-// const image = await Camera.getPhoto({
-// quality: 90,
-// allowEditing: false,
-// resultType: CameraResultType.Uri,
-// source: CameraSource.Camera // Camera, Photos or Prompt!
-// });
-
-// if (image) {
-// this.saveImage(image)
-// }
-// }
-// Create a new file from a capture image
-/* async saveImage(photo: Photo) {
- const base64Data = await this.readAsBase64(photo);
-
- const fileName = new Date().getTime() + '.jpeg';
- const savedFile = await Filesystem.writeFile({
- path: `${IMAGE_DIR}/${fileName}`,
- data: base64Data,
- directory: Directory.Data
- });
-
- // Reload the file list
- // Improve by only loading for the new image and unshifting array!
- this.loadFiles();
-} */
-
-// https://ionicframework.com/docs/angular/your-first-app/3-saving-photos
-// private async readAsBase64(photo: Photo) {
-// if (this.platform.is('hybrid')) {
-// const file = await Filesystem.readFile({
-// path: photo.path
-// });
-
-// return file.data;
-// }
-// else {
-// // Fetch the photo, read as a blob, then convert to base64 format
-// const response = await fetch(photo.webPath);
-// const blob = await response.blob();
-
-// return await this.convertBlobToBase64(blob) as string;
-// }
-// }
-
-// Helper function
-convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
- const reader = new FileReader;
- reader.onerror = reject;
- reader.onload = () => {
+ convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
+ const reader = new FileReader;
+ reader.onerror = reject;
+ reader.onload = () => {
resolve(reader.result);
- };
- reader.readAsDataURL(blob);
-});
-
-
- async startUpload(file: LocalFile) {
- // TODO
- }
-
- async deleteImage(file: LocalFile) {
- // TODO
- }
-
-
-
-// async takePicture() {
-// const capturedImage = await Camera.getPhoto({
-// quality: 90,
-// // allowEditing: true,
-// resultType: CameraResultType.Uri,
-// source: CameraSource.Camera
-
-// });
-
-// }
-
-// convertBlobToBase64 = (blob: Blob) => new Promise((resolve, reject) => {
-// const reader = new FileReader;
-// reader.onerror = reject;
-// reader.onload = () => {
-// resolve(reader.result);
-// };
-// reader.readAsDataURL(blob);
-// });
+ };
+ reader.readAsDataURL(blob);
+ });
async laodPicture() {
@@ -291,6 +199,8 @@ private async savePicture(photo: Photo) {
} */
+
+
runValidation() {
this.validateFrom = true
}
@@ -519,9 +429,9 @@ private async savePicture(photo: Photo) {
}
}
- // // Create a new file from a capture image
- async saveImage(photo: Photo) {
- const base64Data = await this.readAsBase64(photo);
+ // Create a new file from a capture image
+ async saveImage(photo: Photo) {
+ const base64Data = await this.readAsBase64(photo);
const fileName = new Date().getTime() + '.jpeg';
const savedFile = await Filesystem.writeFile({
diff --git a/src/app/shared/agenda/edit-event/edit-event.page.ts b/src/app/shared/agenda/edit-event/edit-event.page.ts
index 36759d852..f66e97819 100644
--- a/src/app/shared/agenda/edit-event/edit-event.page.ts
+++ b/src/app/shared/agenda/edit-event/edit-event.page.ts
@@ -197,6 +197,7 @@ export class EditEventPage implements OnInit {
]),
})
+
}
openInicio() {
@@ -256,7 +257,8 @@ export class EditEventPage implements OnInit {
this.showLoader = true;
- await this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
+ try {
+ await this.eventsService.editEvent(this.postEvent, 2, 3).toPromise()
if(this.initCalendarName != this.postEvent.CalendarName) {
let body = {
"EventId": this.postEvent.EventId,
@@ -269,11 +271,10 @@ export class EditEventPage implements OnInit {
}
this.showLoader = false;
this.toastService.successMessage()
- },
- error => {
+ } catch(error) {
this.showLoader = false
this.toastService.badRequest()
- });
+ }
this.clearPostEvent.emit();
this.deleteTemporaryData();
diff --git a/src/app/shared/gabinete-digital/pedidos/pedidos.page.html b/src/app/shared/gabinete-digital/pedidos/pedidos.page.html
index 898c7c71c..d552bb84a 100644
--- a/src/app/shared/gabinete-digital/pedidos/pedidos.page.html
+++ b/src/app/shared/gabinete-digital/pedidos/pedidos.page.html
@@ -110,7 +110,7 @@
Lista vazia
@@ -119,7 +119,7 @@