-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
3272 update message date overnight #3573
3272 update message date overnight #3573
Conversation
const updateCurrentDate = _.throttle(() => { | ||
const currentDate = moment().format('YYYY-MM-DD'); | ||
Onyx.set(ONYXKEYS.CURRENT_DATE, currentDate); | ||
}, 1000 * 60 * 60 * 3); // 3 hours |
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.
Out of curiosity, why 3 hours?
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.
Ah nevermind, I see the context in the issue :)
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging in version: 1.0.68-5🚀
|
🚀 Deployed to production in version: 1.0.73-3🚀
|
Details
Adds a new Onyx store key for current date. The value is updated via a function throttled by 3 hours that is called on user interaction. That value is passed into
ReportActionItemDate
component as a prop, so it re-renders when the prop changes, causing thetimestampToDate
to be recalculated.Fixed Issues
Fixes #3272
Tests
DateUtils.js
updateCurrentDate
function!!! Important !!! Don't mouse over the message itself. From my observations, It causes a re-render that is unrelated to this PR and doesn't validate that my code works. To validate this PR, please move the mouse cursor around the LHN section or other messages.
QA Steps
!!! Important !!! Don't mouse over the message itself. From my observations, It causes a re-render that is unrelated to this PR and doesn't validate that my code works. To validate this PR, please move the mouse cursor around the LHN section or other messages.
Tested On
The change only affects web and desktop.
Screenshots
Videos of development tests. With manual system time change and a throttle timer of 15 seconds. Find system time in top right corner.
Web
3272-web.mp4
Mobile Web
3272-mweb.mp4
Desktop
3272-desktop.mp4
iOS
Android