Skip to content

Commit fcf2918

Browse files
committed
fix: remove google search & adjust invalid url handling
1 parent 15fd26d commit fcf2918

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/pages/dapp/dapp.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,11 @@ const DappPage = () => {
246246
if (isValid) {
247247
// jump to website
248248
setSelectedURL(finalURL);
249-
} else {
250-
// google search
251-
setSelectedURL(`https://www.google.com/search?q=${finalURL}`);
252249
}
250+
// else {
251+
// // google search
252+
// setSelectedURL(`https://www.google.com/search?q=${finalURL}`);
253+
// }
253254
}}
254255
/>
255256
{shouldShowBrowser && (

src/utils/utils.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ interface ValidURLCheckResult {
313313

314314
export function isValidURL(str: string): ValidURLCheckResult {
315315
try {
316-
if (!str.startsWith('https://') && !str.startsWith('http://')) {
317-
str = 'https://' + str;
318-
}
316+
// if (!str.startsWith('https://') && !str.startsWith('http://')) {
317+
// str = 'https://' + str;
318+
// }
319319
const parsedUrl = new URL(str);
320320
const regex = /^([a-zA-Z0-9-_.:]+)+$/;
321321
return {

0 commit comments

Comments
 (0)