Skip to content

Commit c1e3399

Browse files
committed
chore: update openURL logic
1 parent e8c2a86 commit c1e3399

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/uikit-react-native/src/libs/SBUUtils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ export default class SBUUtils {
1111

1212
static async openURL(url: string) {
1313
try {
14-
const targetUrl = url.startsWith('http') ? url : 'https://' + url;
14+
let targetUrl = url;
15+
if (!url.startsWith('http://') && !url.startsWith('https://')) {
16+
targetUrl = 'https://' + url;
17+
}
1518
await Linking.openURL(targetUrl);
1619
} catch (e) {
1720
Logger.warn('Cannot open url', e);

0 commit comments

Comments
 (0)