diff --git a/app/lib/methods/helpers/openLink.ts b/app/lib/methods/helpers/openLink.ts index e7fc9a561..092d527d4 100644 --- a/app/lib/methods/helpers/openLink.ts +++ b/app/lib/methods/helpers/openLink.ts @@ -36,10 +36,17 @@ const appSchemeURL = (url: string, browser: string): string => { return schemeUrl; }; +const addProtocol = (url: string): string => { + if (!url.toLowerCase().startsWith('http')) { + return `https://${url}`; + } + return url; +}; + const openLink = async (url: string, theme: TSupportedThemes = 'light'): Promise => { try { const browser = UserPreferences.getString(DEFAULT_BROWSER_KEY); - + url = addProtocol(url); if (browser === 'inApp') { await WebBrowser.openBrowserAsync(url, { toolbarColor: themes[theme].headerBackground,