From eb52091e9d66fbfce2249b2aa813e6cf8ac7c61d Mon Sep 17 00:00:00 2001 From: Hamza Date: Thu, 27 Mar 2025 17:59:42 +0100 Subject: [PATCH] fix: start activity screen shown after submission - Add a little workaround to fix this by showing a white screen right before the redirect --- src/entities/applet/model/hooks/useEntityComplete.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/entities/applet/model/hooks/useEntityComplete.ts b/src/entities/applet/model/hooks/useEntityComplete.ts index 669093dfd..17ccef13e 100644 --- a/src/entities/applet/model/hooks/useEntityComplete.ts +++ b/src/entities/applet/model/hooks/useEntityComplete.ts @@ -73,19 +73,23 @@ export const useEntityComplete = (props: Props) => { } if (prolificParams && props.publicAppletKey) { + const { data: completionCodesReponse } = await fetchCompletionCodes(); + removeActivityProgress({ activityId: props.activityId, eventId: props.eventId, targetSubjectId: props.targetSubjectId, }); - const { data: completionCodesReponse } = await fetchCompletionCodes(); if (!isCompletionCodesReponseError && completionCodesReponse) { clearProlificParams(); // Resetting redux state after completion const { completionCodes } = completionCodesReponse.data; for (const code of completionCodes) { if (code.codeType === 'COMPLETED') { + // There is a delay in the redirect, the start screen is shown for a second + // before the redirect to prolific happens. This is a workaround to hide that screen during that time. + document.body.innerHTML = ''; return window.location.replace( `https://app.prolific.com/submissions/complete?cc=${code.code}`, );