Skip to content

Commit

Permalink
fix: shared link
Browse files Browse the repository at this point in the history
  • Loading branch information
RFbkak37y3kIY committed May 2, 2024
1 parent e90cc33 commit 8f68505
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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() {
Expand Down

0 comments on commit 8f68505

Please sign in to comment.