fix relative links,

This commit is contained in:
Jason Kulatunga 2023-09-06 19:50:01 -07:00
parent bf03a987f3
commit 6691837797
1 changed files with 5 additions and 0 deletions

View File

@ -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)