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