From 2d8499c0bca3e2978bc1b593e4a0e39a87c08612 Mon Sep 17 00:00:00 2001 From: vaishnavipy Date: Mon, 31 Oct 2022 12:09:14 -0400 Subject: [PATCH] guest login and favorite bug fix --- constants/RecordIds.js | 2 +- lib/mapUtils.js | 4 ++-- navigation/DrawerContent.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/constants/RecordIds.js b/constants/RecordIds.js index 7d2aac48..d309c3f7 100644 --- a/constants/RecordIds.js +++ b/constants/RecordIds.js @@ -18,7 +18,7 @@ if (env === 'dev') { // IDs from PROD base } else if (env === 'prod') { RecordIds.testCustomerId = 'recomWMtzSUQCcIvr'; - RecordIds.guestCustomerId = 'recxEGfvExP4Dv8nr'; + RecordIds.guestCustomerId = 'recHSoc8R94UYNIR5'; RecordIds.defaultStoreId = 'recwQ6SoM5pEj37xl'; RecordIds.surveyStoreId = 'recQa6jv9KGqobDAZ'; } diff --git a/lib/mapUtils.js b/lib/mapUtils.js index 34d90672..3b2de2c8 100644 --- a/lib/mapUtils.js +++ b/lib/mapUtils.js @@ -356,7 +356,7 @@ export async function toggleFavoriteStore(navigation, storeId) { ] ); } else { - const cust = await getCustomerById(customerId); + const cust = await getCustomerById(customerId.id); let favoriteStores = cust.favoriteStoreIds || []; if (favoriteStores.includes(storeId)) { @@ -381,7 +381,7 @@ export async function toggleFavoriteStore(navigation, storeId) { ); } } - await updateCustomer(customerId, { + await updateCustomer(customerId.id, { favoriteStoreIds: favoriteStores, }); success = true; diff --git a/navigation/DrawerContent.js b/navigation/DrawerContent.js index 5c9e3565..e818a5ae 100644 --- a/navigation/DrawerContent.js +++ b/navigation/DrawerContent.js @@ -44,7 +44,6 @@ function DrawerContent(props) { const fetchUser = async () => { try { const customerId = await getAsyncCustomerAuth(); - let cust = null; if (customerId != null) { cust = await getCustomerById(customerId.id); @@ -100,6 +99,7 @@ function DrawerContent(props) { } const isGuest = customer.name === 'Guest'; + return (