Skip to content

Commit

Permalink
fix relative links,
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Sep 7, 2023
1 parent bf03a98 commit 6691837
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/src/app/directives/external-link.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ export class ExternalLinkDirective {

let url: string = (<any>event.currentTarget).getAttribute("href") || (<any>event.target).getAttribute("href");

//check if url starts with https, and if not, prepend it (external links are never relative)
if(!url.startsWith("https://") && !url.startsWith("http://")){
url = "https://" + url;
}

//check if wails exists and is defined
if(typeof wails !== "undefined" && environment.environment_desktop){
wails.CallByName("pkg.AppService.BrowserOpenURL", url)
Expand Down

0 comments on commit 6691837

Please # to comment.