Skip to content

Commit

Permalink
When popups are blocked by browser navigateToURL throws an expected e…
Browse files Browse the repository at this point in the history
…xception

- Adding try/catch to clean that issue (reference #53)
  • Loading branch information
piotrzarzycki21 committed May 10, 2024
1 parent 9da5186 commit 7f7ec72
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ package controller
0, "Close");
}

navigateToURL(new URLRequest(link));
try
{
navigateToURL(new URLRequest(link), "_blank");
}
catch(error:Error)
{

}

data = null;
}
Expand Down Expand Up @@ -88,7 +95,15 @@ package controller
{
// An error was reported. Open the Nomad URL in a new tab. If Nomad is already open, the database will be opened in the original tab.
winMessage = winMessage.substr(errorPrefix.length, winMessage.length);
navigateToURL(new URLRequest(data.link));

try
{
navigateToURL(new URLRequest(data.link), "_blank");
}
catch(e:Error)
{

}
}
else if (successIndex > -1)
{
Expand Down

0 comments on commit 7f7ec72

Please sign in to comment.