3272 update message date overnight#3573
Merged
francoisl merged 3 commits intoExpensify:mainfrom Jun 14, 2021
Merged
Conversation
francoisl
reviewed
Jun 14, 2021
| const updateCurrentDate = _.throttle(() => { | ||
| const currentDate = moment().format('YYYY-MM-DD'); | ||
| Onyx.set(ONYXKEYS.CURRENT_DATE, currentDate); | ||
| }, 1000 * 60 * 60 * 3); // 3 hours |
Contributor
There was a problem hiding this comment.
Out of curiosity, why 3 hours?
Contributor
There was a problem hiding this comment.
Ah nevermind, I see the context in the issue :)
francoisl
approved these changes
Jun 14, 2021
Contributor
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Contributor
|
🚀 Deployed to staging in version: 1.0.68-5🚀
|
Contributor
|
🚀 Deployed to production in version: 1.0.73-3🚀
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ReportActionItemDatecomponent as a prop, so it re-renders when the prop changes, causing thetimestampToDateto be recalculated.Fixed Issues
Fixes #3272
Tests
DateUtils.jsupdateCurrentDatefunction!!! 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