-
Notifications
You must be signed in to change notification settings - Fork 16
fix: Campaign Message Tab Displays Incorrect Data for "Alternate Days" and "Alternate Weeks (≥2)" Schedules #4741
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -94,6 +94,13 @@ export const useCampaignSetupForm = () => { | |||||||||||||||||||||||||||||
| const [submitAttempted, setSubmitAttempted] = useState(false); | ||||||||||||||||||||||||||||||
| const [rewardSubmitAttempted, setRewardSubmitAttempted] = useState(false); | ||||||||||||||||||||||||||||||
| const [message, setMessage] = useState<CampaignSetupMessage>(null); | ||||||||||||||||||||||||||||||
| const assignmentFrequency = useMemo( | ||||||||||||||||||||||||||||||
| () => | ||||||||||||||||||||||||||||||
| assignmentConfigs[activeAssignmentGradeId]?.frequency ?? | ||||||||||||||||||||||||||||||
| Object.values(assignmentConfigs)[0]?.frequency ?? | ||||||||||||||||||||||||||||||
| DEFAULT_FREQUENCY, | ||||||||||||||||||||||||||||||
| [activeAssignmentGradeId, assignmentConfigs], | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
|
Comment on lines
+97
to
+103
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The import { DEFAULT_FREQUENCY } from '../components/campaignSetup/campaignAssignmentUtils';Additionally, to prevent potential runtime errors if
Suggested change
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| const audience = useCampaignAudienceSelection({ | ||||||||||||||||||||||||||||||
| api, | ||||||||||||||||||||||||||||||
|
|
@@ -431,6 +438,7 @@ export const useCampaignSetupForm = () => { | |||||||||||||||||||||||||||||
| assignmentOptions, | ||||||||||||||||||||||||||||||
| areRewardsValid, | ||||||||||||||||||||||||||||||
| assignmentConfigs, | ||||||||||||||||||||||||||||||
| assignmentFrequency, | ||||||||||||||||||||||||||||||
| assignmentDrafts, | ||||||||||||||||||||||||||||||
| campaignRewards, | ||||||||||||||||||||||||||||||
| createdCampaignId, | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To prevent potential runtime errors or passing undefined values to
buildFrequencyTimelineDates, we should ensure that bothform.startDateandform.endDateare defined before calling the function.