From 56d6515e2e05df42f348c7a9e6bc1205c8d079fa Mon Sep 17 00:00:00 2001 From: zant Date: Thu, 16 Jan 2025 16:06:07 +0100 Subject: [PATCH] fix: add visit permission based on early exit --- app/(auth)/(visit)/summary.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/(auth)/(visit)/summary.tsx b/app/(auth)/(visit)/summary.tsx index d0d6025..2339859 100644 --- a/app/(auth)/(visit)/summary.tsx +++ b/app/(auth)/(visit)/summary.tsx @@ -80,7 +80,7 @@ export default function Summary() { const completeVisitData = { ...visitData, house: visitData.houseId ? undefined : visitData.house, - visitPermission: true, + visitPermission: notAllowed__EarlyExit ? false : true, host: user.firstName, visitedAt: new Date(), inspections, @@ -93,10 +93,10 @@ export default function Summary() { try { // We only make the request if it's connected - if (isConnected) { - rollbar.log(JSON.stringify(sanitizedVisitData)); + if (isConnected) await createVisit({ json_params: JSON.stringify(sanitizedVisitData) }); - } + if (isConnected && rollbar) + rollbar.log(JSON.stringify(sanitizedVisitData)); Toast.show({ type: "success",