chore: fix ui bug

This commit is contained in:
2026-03-25 09:41:53 +01:00
parent 79c050d689
commit ac5ec11f54
4 changed files with 66 additions and 24 deletions
@@ -38,6 +38,7 @@ import {
getLivreurTelegramStatus,
generateLivreurLinkToken,
unlinkLivreurTelegram,
getDeliveryNavLink,
} from "../../api/api_delivery";
import { geocodeAddress, calculateRoute } from "../../api/tomtom";
import type { RouteInfo } from "../../api/tomtom";
@@ -520,13 +521,12 @@ export default function DashboardScreen() {
}
};
const openNavigation = (address: string) => {
const encoded = encodeURIComponent(address);
const wazeApp = `waze://?q=${encoded}&navigate=yes`;
const wazeWeb = `https://waze.com/ul?q=${encoded}&navigate=yes`;
Linking.openURL(wazeApp).catch(() => {
Linking.openURL(wazeWeb);
});
const openNavigation = async (deliveryId: number, address: string) => {
const res = await getDeliveryNavLink(deliveryId);
const link = res.success && res.waze_app
? res.waze_app
: `waze://?q=${encodeURIComponent(address)}&navigate=yes`;
Linking.openURL(link);
};
// --------------------------------------------------
@@ -577,7 +577,7 @@ export default function DashboardScreen() {
<TouchableOpacity
style={styles.addressRow}
onPress={() => openNavigation(item.adresse)}
onPress={() => openNavigation(item.id, item.adresse)}
activeOpacity={0.7}
>
<Ionicons