From 220e865af9394750110f7b863b5450c7891e2478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Tue, 26 Nov 2024 14:23:09 +0000 Subject: [PATCH] fix: Update other auto references --- .../pages/FlowEditor/lib/analytics/provider.tsx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/analytics/provider.tsx b/editor.planx.uk/src/pages/FlowEditor/lib/analytics/provider.tsx index e04b15a4bc..edaff87f07 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/analytics/provider.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/lib/analytics/provider.tsx @@ -198,24 +198,16 @@ export const AnalyticsProvider: React.FC<{ children: React.ReactNode }> = ({ const { id, created_at: newLogCreatedAt } = result?.data.insert_analytics_logs_one || {}; - if (!id || !newLogCreatedAt) { - return; - } + if (!id || !newLogCreatedAt) return; - if ( - lastVisibleNodeAnalyticsLogId && - newLogCreatedAt && - !metadata.isAutoAnswered - ) { + if (lastVisibleNodeAnalyticsLogId && newLogCreatedAt) { updateLastLogWithNextLogCreatedAt( lastVisibleNodeAnalyticsLogId, newLogCreatedAt, ); } - if (!metadata.isAutoAnswered) { - lastVisibleNodeAnalyticsLogId = id; - } + lastVisibleNodeAnalyticsLogId = id; } async function insertNewAnalyticsLog(