From 8f685058a63126f8e811808a5cebf6a6bcb435d3 Mon Sep 17 00:00:00 2001 From: Eduard Klimenko Date: Thu, 2 May 2024 19:56:48 +0300 Subject: [PATCH] fix: shared link --- .../tab-export/tab-export.component.ts | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/app/components/search-grid-call/detail-dialog/tab-export/tab-export.component.ts b/src/app/components/search-grid-call/detail-dialog/tab-export/tab-export.component.ts index 3a0c09b7..a1265d88 100644 --- a/src/app/components/search-grid-call/detail-dialog/tab-export/tab-export.component.ts +++ b/src/app/components/search-grid-call/detail-dialog/tab-export/tab-export.component.ts @@ -335,7 +335,11 @@ export class TabExportComponent implements OnInit, AfterViewInit { // window.open(this.url, '_blank'); // } getOrigin() { - return (window.location.origin + window["base-href"]).replace(/\/$/, '') + console.log([window.location.origin, window["base-href"]]); + if (typeof window["base-href"] === 'string') { + return (window.location.origin + window["base-href"]).replace(/\/$/, '') + } + return (window.location.origin).replace(/\/$/, '') } onShareLink() { // const param = Functions.getUriJson(); @@ -348,15 +352,15 @@ export class TabExportComponent implements OnInit, AfterViewInit { async onCopyLink() { if (this.url === '') { const data = await this._ecs.postShareLink(this.getQuery()).toPromise(); - if (data.data.url === '/share/#') { - this.url = this.getOrigin() + data.data.url + data.data.uuid; - } else { - this.url = data.data.url + data.data.uuid; - } + if (data.data.url === '/share/#') { + this.url = this.getOrigin() + data.data.url + data.data.uuid; + } else { + this.url = data.data.url + data.data.uuid; + } } this.copyService.copy(this.url, { - message: 'notifications.success.shareLinkCopy', - isTranslation: true, + message: 'notifications.success.shareLinkCopy', + isTranslation: true, }); } onExportFlowAsPNG() {