chore: fix waze
This commit is contained in:
@@ -460,11 +460,11 @@ export default function DashboardScreen() {
|
||||
|
||||
const openNavigation = (address: string) => {
|
||||
const encoded = encodeURIComponent(address);
|
||||
let url = `https://waze.com/ul?q=${encoded}&navigate=yes`;
|
||||
if (lastCoords) {
|
||||
url += `&ll=${lastCoords.lat},${lastCoords.lng}`;
|
||||
}
|
||||
Linking.openURL(url);
|
||||
const wazeApp = `waze://?q=${encoded}&navigate=yes`;
|
||||
const wazeWeb = `https://waze.com/ul?q=${encoded}&navigate=yes`;
|
||||
Linking.canOpenURL(wazeApp).then((supported) => {
|
||||
Linking.openURL(supported ? wazeApp : wazeWeb);
|
||||
});
|
||||
};
|
||||
|
||||
// --------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user