From d5a98ea601d8df401d0524d51bc073d4a135044d Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Fri, 23 Feb 2024 12:22:56 +0100 Subject: [PATCH] add message incase document link is not a valida link --- .../viewer-attachment/viewer-attachment.page.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/app/pages/gabinete-digital/viewer-attachment/viewer-attachment.page.ts b/src/app/pages/gabinete-digital/viewer-attachment/viewer-attachment.page.ts index 7a786cea3..b773abb77 100644 --- a/src/app/pages/gabinete-digital/viewer-attachment/viewer-attachment.page.ts +++ b/src/app/pages/gabinete-digital/viewer-attachment/viewer-attachment.page.ts @@ -76,14 +76,17 @@ export class ViewerAttachmentPage implements OnInit { // Optionally, you can add new content or recreate the iframe var newIframe = document.createElement('iframe'); - newIframe.src = linkRequest.value; + if(linkRequest.value.includes("http")) { + newIframe.src = linkRequest.value; - newIframe.width = '100%' - newIframe.height = '100%' + newIframe.width = '100%' + newIframe.height = '100%' + this.iframeContainer.nativeElement.innerHTML = "" + this.iframeContainer.nativeElement.appendChild(newIframe) - this.iframeContainer.nativeElement.innerHTML = "" - this.iframeContainer - this.iframeContainer.nativeElement.appendChild(newIframe) + } else { + this.iframeContainer.nativeElement.innerHTML = "Sem documento" + } this.iframeContainer.nativeElement.style.display = 'flex' } else {