[fix] Linking.openURL opens 'tel' links in current tab.

Close #2125
Fix #2124
This commit is contained in:
youngvform
2021-09-11 20:05:52 +09:00
committed by Nicolas Gallagher
parent e217f737ab
commit 438b7b7281
+5 -1
View File
@@ -88,7 +88,11 @@ class Linking {
const open = (url) => {
if (canUseDOM) {
const urlToOpen = new URL(url, window.location).toString();
window.open(urlToOpen, '_blank', 'noopener');
if (urlToOpen.indexOf('tel:') === 0) {
window.location = urlToOpen;
} else {
window.open(urlToOpen, '_blank', 'noopener');
}
}
};