Skip to content

Commit

Permalink
fix: Update other auto references
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Nov 26, 2024
1 parent 0e2c8aa commit 220e865
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions editor.planx.uk/src/pages/FlowEditor/lib/analytics/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 220e865

Please sign in to comment.