This commit is contained in:
tiago.kayaya
2021-12-06 16:02:47 +01:00
21 changed files with 245 additions and 164 deletions
+21 -8
View File
@@ -10,13 +10,13 @@ import { SearchList } from 'src/app/models/search-document';
import { ProcessesService } from '../processes.service';
import { ToastService } from '../toast.service';
import { Camera, CameraResultType, CameraSource, Photo} from '@capacitor/camera';
import { Filesystem, Directory } from '@capacitor/filesystem';
import { environment } from 'src/environments/environment';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
const IMAGE_DIR = 'stored-images';
interface LocalFile {
name: string;
path: string;
@@ -261,13 +261,6 @@ export class FileService {
if (image) {
await this.saveImage(image,roomId)
}
/* const response = await fetch(capturedImage.webPath!);
const blob = await response.blob();
this.photos.unshift({
filepath: "soon...",
webviewPath: capturedImage.webPath
}); */
//this.capturedImage = this.capturedImage;
@@ -287,6 +280,8 @@ export class FileService {
if (capturedImage) {
await this.saveImage(capturedImage,roomId)
}
/* const response = await fetch(capturedImage.webPath!);
const blob = await response.blob();
@@ -320,6 +315,24 @@ export class FileService {
//loader.remove();
});
*/ }
async shareLocalFile(){
this.http.get('./assets/any.svg', {responseType: 'blob'}).subscribe(res=>{
const reader = new FileReader()
reader.onloadend=()=>{
const result = reader.result as string
const base64Data = result.split(',')[1]
/* FileSharer.share({
filename:'any.pdf',
base64Data,
contentType: "application/pdf",
}) */
reader.readAsDataURL(res)
}
})
}
addPictureToChat(roomId) {