Skip to content

Commit

Permalink
fix: generate single survey Ids in summary only if enabled (formbrick…
Browse files Browse the repository at this point in the history
  • Loading branch information
ShubhamPalriwala committed Oct 4, 2023
1 parent cd34d89 commit ec67816
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ export default async function Page({ params }) {
getEnvironment(params.environmentId),
]);
const isSingleUseSurvey = survey.singleUse?.enabled ?? false;
const singleUseIds = generateSingleUseIds(survey.singleUse?.isEncrypted ?? false);

let singleUseIds: string[] | undefined = undefined;
if (isSingleUseSurvey) {
singleUseIds = generateSingleUseIds(survey.singleUse?.isEncrypted ?? false);
}

if (!environment) {
throw new Error("Environment not found");
}
Expand Down

0 comments on commit ec67816

Please sign in to comment.