mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
remove rocket chat
This commit is contained in:
@@ -78,12 +78,12 @@ export class FileService {
|
||||
path: IMAGE_DIR,
|
||||
directory: Directory.Data,
|
||||
}).then(result => {
|
||||
|
||||
|
||||
let lastphoto = result.files[result.files.length - 1]
|
||||
resolve(lastphoto)
|
||||
},
|
||||
async (err) => {
|
||||
|
||||
|
||||
reject('ERROR FILE DOSENT EXIST')
|
||||
// Folder does not yet exists!
|
||||
await Filesystem.mkdir({
|
||||
@@ -127,7 +127,7 @@ export class FileService {
|
||||
|
||||
//new method 4
|
||||
async loadFileData(fileName: string) {
|
||||
|
||||
|
||||
// for (let f of fileNames) {
|
||||
const filePath = `${IMAGE_DIR}/${fileName}`;
|
||||
|
||||
@@ -139,7 +139,7 @@ export class FileService {
|
||||
data: `data:image/jpeg;base64,${readFile.data}`,
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
const capturedImage = image.data
|
||||
|
||||
@@ -150,9 +150,7 @@ export class FileService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
getFileFromDevice(types: typeof FileType[]) {
|
||||
getFileFromDevice(types: typeof FileType[]): Promise<File> {
|
||||
const input = this.fileLoaderService.createInput({
|
||||
accept: types
|
||||
})
|
||||
@@ -168,9 +166,6 @@ export class FileService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
getFileFromDeviceBase64(types: typeof FileType[]) {
|
||||
const input = this.fileLoaderService.createInput({
|
||||
accept: types
|
||||
@@ -199,7 +194,7 @@ export class FileService {
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
viewDocumentByUrl(url) {
|
||||
const browser = this.iab.create(url,"_parent");
|
||||
@@ -254,8 +249,8 @@ export class FileService {
|
||||
dataURLtoFile(dataurl, filename) {
|
||||
var arr = dataurl.split(','),
|
||||
mime = arr[0].match(/:(.*?);/)[1],
|
||||
bstr = atob(arr[arr.length - 1]),
|
||||
n = bstr.length,
|
||||
bstr = atob(arr[arr.length - 1]),
|
||||
n = bstr.length,
|
||||
u8arr = new Uint8Array(n);
|
||||
while(n--){
|
||||
u8arr[n] = bstr.charCodeAt(n);
|
||||
@@ -267,11 +262,11 @@ export class FileService {
|
||||
contentType = contentType || '';
|
||||
const byteCharacters = atob(base64Data);
|
||||
const byteArray = new Uint8Array(byteCharacters.length);
|
||||
|
||||
|
||||
for (let i = 0; i < byteCharacters.length; i++) {
|
||||
byteArray[i] = byteCharacters.charCodeAt(i);
|
||||
}
|
||||
|
||||
|
||||
return new Blob([byteArray], { type: contentType });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user