(url: Link)
| 13 | * @param url - The URL to open. |
| 14 | */ |
| 15 | export function openExternalLink(url: Link): void { |
| 16 | // Load the state from local storage to avoid having to pass settings as a parameter |
| 17 | const { settings } = loadState(); |
| 18 | const openPreference = settings |
| 19 | ? settings.openLinks |
| 20 | : defaultSettings.openLinks; |
| 21 | |
| 22 | if (url.toLowerCase().startsWith('https://')) { |
| 23 | window.gitify.openExternalLink( |
| 24 | url, |
| 25 | openPreference === OpenPreference.FOREGROUND, |
| 26 | ); |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Returns the current application version string. |
no test coverage detected