Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(surveys): make link survey link optional #938

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/extensions/surveys/surveys-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,8 @@ export const createOpenTextOrLinkPopup = (
[`$survey_responded/${survey.id}`]: true,
},
})
if (surveyQuestionType === 'link') {
window.open(question.link || undefined)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, why did we do it like this previously? window.open(undefined) opens an empty tab.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we originally required link urls for link type surveys so the button was always going to open something one way or another 😅

I think window.open("") would open something weird so passing in undefined was better

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the CTA do now, if it doesn't link to something? 🤔

if (surveyQuestionType === 'link' && question.link) {
window.open(question.link)
}
window.setTimeout(() => {
window.dispatchEvent(new Event('PHSurveySent'))
Expand Down