replicate contact function

This commit is contained in:
Peter Maquiran
2023-08-21 12:27:17 +01:00
15 changed files with 161 additions and 88 deletions
@@ -1060,7 +1060,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
return blob;
}
openFile(pdfString, filename, type) {
async openFile(pdfString, filename, type) {
const blob = this.b64toBlob(pdfString, 'application/pdf')
let pathFile = ''
const fileName = filename
@@ -1071,17 +1071,17 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
pathFile = this.file.externalRootDirectory
}
this.file
.writeFile(pathFile, fileName, contentFile, { replace: true })
.then(success => {
this.fileOpener
.open(pathFile + fileName, 'application/pdf')
await Filesystem.writeFile({
path: fileName,
data: pdfString,
directory: Directory.Documents,
}).then((dir) => {
console.log('DIR ', dir)
this.fileOpener
.open(dir.uri, type)
.then(() => console.log())
.catch(e => console.error(e))
})
.catch(e => console.error(e))
});
}
downloadFileMsg(msg: MessageService) {
+13 -10
View File
@@ -1001,8 +1001,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
return blob;
}
openFile(pdfString, filename, type) {
async openFile(pdfString, filename, type) {
const blob = this.b64toBlob(pdfString, type)
console.log(blob)
let pathFile = ''
const fileName = filename
const contentFile = blob
@@ -1012,17 +1013,19 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
pathFile = this.file.externalRootDirectory
}
this.file
.writeFile(pathFile, fileName, contentFile, { replace: true })
.then(success => {
this.fileOpener
.open(pathFile + fileName, type)
console.log(pathFile)
await Filesystem.writeFile({
path: fileName,
data: pdfString,
directory: Directory.Documents,
}).then((dir) => {
console.log('DIR ', dir)
this.fileOpener
.open(dir.uri, type)
.then(() => console.log())
.catch(e => console.error(e))
})
.catch(e => console.error(e))
});
}
downloadFileFromBrowser(fileName: string, data: any): void {
+1 -1
View File
@@ -143,7 +143,7 @@
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
<div class="text">Correspondência por ler</div>
</div>
<button title="Ir para o Gabinete Digital" (click)="viewExpedientListPage()" class="btn-no-color cursor-pointer">
<button title="Ir para o Gabinete Digital" (click)="goToAllTaskFilter('unread')" class="btn-no-color cursor-pointer">
<ion-icon
*ngIf="ThemeService.currentTheme == 'default' "
class="icon-next"
@@ -173,7 +173,7 @@
desktopComponent.showPublicationDetail == false &&
desktopComponent.showAddActions == false &&
desktopComponent.showEditActions == false
)"><div>Nenhuma ação presidencial selecionada</div></div>
)"><div>Nenhuma acção presidencial selecionada</div></div>
<!-- View Publication -->
<app-view-publications