-
Notifications
You must be signed in to change notification settings - Fork 12
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
only show ongoing/future pause notifications info #988
only show ongoing/future pause notifications info #988
Conversation
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.
Can you instead adjust the variable notificationsArePaused
?
Also don't use greater/less than operators on strings. That's the worst heresy I've seen in last few years 😆 Despite all JS quirks it is still surprising it works at all.
Also mark checklist items as done |
I can't adjust the variable because it should show the info also before the pause |
|
||
if (notificationsArePaused) { | ||
if (pausedFrom <= today && pausedTo >= today) { |
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.
I'd be easier to understand if you used variables. Maybe notificationsArePaused
or notificationsWillBePaused
or whatever you're checking for in that if condition.
pausedTo != '' && pausedTo >= today | ||
); | ||
const today = getTodayTimestamp(); | ||
const pausedFrom = parseISODate(props.fullUser.notification_schedule?.pause_from); |
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.
FYI you can parse by passing a string to constructor new Date('2024-01-01')
CPCN-844
Checklist
lodash.get
with optional chaining for modified code segments