From a5562970cb302890719d0441525cafc434e4be51 Mon Sep 17 00:00:00 2001 From: Li Yi Yu Date: Tue, 14 Nov 2023 14:17:32 -0500 Subject: [PATCH] thank you messages do not auto disappear --- src/extensions/surveys.ts | 2 +- src/posthog-surveys-types.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/extensions/surveys.ts b/src/extensions/surveys.ts index b15c8c26e..52f783be7 100644 --- a/src/extensions/surveys.ts +++ b/src/extensions/surveys.ts @@ -741,7 +741,7 @@ export const callSurveys = (posthog: PostHog, forceReload: boolean = false) => { }) } const countdownEl = thankYouElement.querySelector('.thank-you-message-countdown') - if (countdownEl) { + if (survey.appearance?.autoDisappear && countdownEl) { let count = 3 countdownEl.textContent = `(${count})` const countdown = setInterval(() => { diff --git a/src/posthog-surveys-types.ts b/src/posthog-surveys-types.ts index b8b986257..30b122b9f 100644 --- a/src/posthog-surveys-types.ts +++ b/src/posthog-surveys-types.ts @@ -9,12 +9,14 @@ export interface SurveyAppearance { backgroundColor?: string submitButtonColor?: string textColor?: string + // deprecate submit button text eventually submitButtonText?: string descriptionTextColor?: string ratingButtonColor?: string ratingButtonActiveColor?: string ratingButtonHoverColor?: string whiteLabel?: boolean + autoDisappear?: boolean displayThankYouMessage?: boolean thankYouMessageHeader?: string thankYouMessageDescription?: string