From 93bdfa636a4e7cf544cd60e46917ee8d7032f3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Garrido?= <57329376+RGarrido03@users.noreply.github.com> Date: Thu, 29 May 2025 00:04:51 +0100 Subject: [PATCH 1/3] fix the fix Co-authored-by: Violeta Ramos --- app/(tabs)/navigation.tsx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/app/(tabs)/navigation.tsx b/app/(tabs)/navigation.tsx index 393c605..55873a4 100644 --- a/app/(tabs)/navigation.tsx +++ b/app/(tabs)/navigation.tsx @@ -47,7 +47,7 @@ const GET_FILTERED_SUPERMARKETS = gql(` `); const NavigationScreen = () => { - const { id, currentListId } = useAuth(); + const { currentListId } = useAuth(); const { toast, toastOnError } = useToast(); const router = useRouter(); const { setState: setBackground } = useBackground(); @@ -116,7 +116,7 @@ const NavigationScreen = () => { }; getLocation().catch(toastOnError); - }, [toast, toastOnError]); + }, [currentListId, refetch, toast, toastOnError]); const { totalQuantity, totalPrice } = useMemo(() => { let quantity = 0; @@ -140,6 +140,23 @@ const NavigationScreen = () => { return () => setBackground(false); }, [debouncedLoading, setBackground]); + if (!currentListId) { + return ( + +
+ + + Oops, hold on! + + + It seems you don't have a shopping list selected. Create or select a + list to start in-store navigation. + + + + ); + } + if (debouncedLoading) { return ( From 80ce10a986e6a4879fe5702c03fc253c4538bf92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Garrido?= <57329376+RGarrido03@users.noreply.github.com> Date: Thu, 29 May 2025 00:10:35 +0100 Subject: [PATCH 2/3] make sonar a bit more happy Co-authored-by: Violeta Ramos --- app/navigation-in-store/index.tsx | 14 -------------- app/productSearch/index.tsx | 2 +- components/ListItem.tsx | 1 - utils/navigation-in-store.ts | 4 ---- 4 files changed, 1 insertion(+), 20 deletions(-) diff --git a/app/navigation-in-store/index.tsx b/app/navigation-in-store/index.tsx index 6057ceb..67254df 100644 --- a/app/navigation-in-store/index.tsx +++ b/app/navigation-in-store/index.tsx @@ -11,7 +11,6 @@ import { FillExtrusionLayer, FillExtrusionLayerStyle, Images, - Light, LineLayer, Logger, MapView, @@ -157,7 +156,6 @@ const NavigationInStore = () => { feature.geometry.coordinates[0] === point.geometry.coordinates[0] && feature.geometry.coordinates[1] === point.geometry.coordinates[1], ); - // TODO: Add and EAN return { ...productData .filter((p) => !picked.includes(p.ean)) @@ -232,7 +230,6 @@ const NavigationInStore = () => { }; useEffect(() => { - let isMounted = true; let resultListener: EmitterSubscription | null = null; let errorListener: EmitterSubscription | null = null; const a = async () => { @@ -256,16 +253,6 @@ const NavigationInStore = () => { const beaconId = data.id; let filteredDistance = data.distance; - // - // if (!kalmanStates.current[beaconId]) { - // // Inicialização do filtro - // kalmanStates.current[beaconId] = { - // x: filteredDistance, - // P: INITIAL_P, - // lastUpdate: now, - // - // }; - // } if (!kalmanStates.current[beaconId]) { // Inicialização com média de 3 leituras const initialReadings = [filteredDistance]; @@ -338,7 +325,6 @@ const NavigationInStore = () => { delete refs[key]; } }); - isMounted = false; resultListener?.remove(); errorListener?.remove(); stopScan().catch(toastOnError); diff --git a/app/productSearch/index.tsx b/app/productSearch/index.tsx index b82c634..43cd172 100644 --- a/app/productSearch/index.tsx +++ b/app/productSearch/index.tsx @@ -69,7 +69,7 @@ const Search = () => { const insets = useSafeAreaInsets(); const router = useRouter(); const { toast, toastOnError } = useToast(); - const { id: userId, currentListId } = useAuth(); + const { currentListId } = useAuth(); const nutriScoreBottomSheetRef = useRef(null); const brandBottomSheetRef = useRef(null); diff --git a/components/ListItem.tsx b/components/ListItem.tsx index fde3720..31443bc 100644 --- a/components/ListItem.tsx +++ b/components/ListItem.tsx @@ -44,7 +44,6 @@ const ListItem = (props: ListItemProps) => { const ContentWrapper = item.type && item.type !== "NORMAL" ? LinearGradient : View; - const ItemWrapper = type === "search" ? TouchableOpacity : View; return ( ) => { ...beaconPositions[id], distance: distance * Math.pow(10, -5), })); - // console.log("MA pooints", points); if (points.length < 3) return null; // Implementação do algoritmo de mínimos quadrados @@ -33,9 +32,6 @@ export const calculatePosition = (distances: Record) => { let x = solution[0]; let y = solution[1]; - // Limitar aos limites do retângulo - // TODO - return { x, y }; } catch (error) { console.error("Erro ao calcular a posição:", error); From ebc17f6433b1f974aadb7162f9cddde6ffec2a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BAben=20Garrido?= <57329376+RGarrido03@users.noreply.github.com> Date: Thu, 29 May 2025 00:12:05 +0100 Subject: [PATCH 3/3] generate apk instead of aab Co-authored-by: Violeta Ramos --- eas.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eas.json b/eas.json index fc4b474..3eac9c4 100644 --- a/eas.json +++ b/eas.json @@ -15,7 +15,10 @@ }, "production": { "autoIncrement": true, - "channel": "production" + "channel": "production", + "android": { + "buildType": "apk" + } } }, "submit": {