diff --git a/src/Views/Layout/ShareModal/index.tsx b/src/Views/Layout/ShareModal/index.tsx index 9ad82d9..576090b 100644 --- a/src/Views/Layout/ShareModal/index.tsx +++ b/src/Views/Layout/ShareModal/index.tsx @@ -30,13 +30,11 @@ const ShareModal = () => { // ? ------------------------- Functions ----------------------- const urlValidation = (url: string) => { - let validated = url; const decoded_url = decodeURIComponent(url); if (!url.includes('://')) { - if (decoded_url.includes('://')) return validated; - validated = `http://${url}`; + if (decoded_url.includes('://')) return url; } - return encodeURIComponent(validated); + return encodeURIComponent(url); }; const getShareLink = (service_title: string, url: string) => { diff --git a/src/Views/Pages/GetButton/index.tsx b/src/Views/Pages/GetButton/index.tsx index 4ade9d9..a955074 100644 --- a/src/Views/Pages/GetButton/index.tsx +++ b/src/Views/Pages/GetButton/index.tsx @@ -134,13 +134,11 @@ const GetButton = () => { }; const urlValidation = (url: string) => { - let validated = url; const decoded_url = decodeURIComponent(url); if (!url.includes('://')) { - if (decoded_url.includes('://')) return validated; - validated = `http://${url}`; + if (decoded_url.includes('://')) return url; } - return encodeURIComponent(validated); + return encodeURIComponent(url); }; const onCheckboxChanged = (val: ValueType | undefined, checked: boolean) => {