fix: Cta button issue on thank you card (#2148)

Co-authored-by: Johannes <72809645+jobenjada@users.noreply.github.com>
Co-authored-by: Johannes <johannes@formbricks.com>
This commit is contained in:
Dhruwang Jariwala
2024-03-01 15:07:42 +05:30
committed by GitHub
parent dbbd450b62
commit cdd93ee86b
3 changed files with 12 additions and 6 deletions

View File

@@ -94,7 +94,7 @@ export default function ShareEmbedSurvey({ survey, open, setOpen, webAppUrl, use
<div className="flex max-w-full flex-col items-center justify-center space-x-2 lg:flex-row">
<div
ref={linkTextRef}
className="mt-2 max-w-[70%] overflow-hidden rounded-lg border border-slate-300 bg-slate-50 px-3 py-2 text-slate-800"
className="mt-2 max-w-[80%] overflow-hidden rounded-lg border border-slate-300 bg-slate-50 px-3 py-2 text-slate-800"
style={{ whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}
onClick={() => handleTextSelection()}>
{surveyUrl}

View File

@@ -162,9 +162,13 @@ export default function LinkSurvey({
getSetIsError={(f: (value: boolean) => void) => {
setIsError = f;
}}
getSetIsResponseSendingFinished={(f: (value: boolean) => void) => {
setIsResponseSendingFinished = f;
}}
getSetIsResponseSendingFinished={
!isPreview
? (f: (value: boolean) => void) => {
setIsResponseSendingFinished = f;
}
: undefined
}
onRetry={() => {
setIsError(false);
responseQueue.processQueue();

View File

@@ -37,8 +37,10 @@ export function Survey({
activeQuestionId || (survey.welcomeCard.enabled ? "start" : survey?.questions[0]?.id)
);
const [showError, setShowError] = useState(false);
// flag state to store whether response processing has been completed or not
const [isResponseSendingFinished, setIsResponseSendingFinished] = useState(false);
// flag state to store whether response processing has been completed or not, we ignore this check for survey editor preview and link survey preview where getSetIsResponseSendingFinished is undefined
const [isResponseSendingFinished, setIsResponseSendingFinished] = useState(
getSetIsResponseSendingFinished ? false : true
);
const [loadingElement, setLoadingElement] = useState(false);
const [history, setHistory] = useState<string[]>([]);