Re-render ReportFooter when transitioning to new chat#11853
Conversation
Julesssss
left a comment
There was a problem hiding this comment.
Nice, this resolved the issue for me 👍
|
Works well for me. C+ reviewed 🎀👀🎀
|
There was a problem hiding this comment.
NAB: I tested and it is fixing it... but wanted to check if you considered updating the local comment stored in ReportActionCompose on componentDidUpdate if the report changes?
App/src/pages/home/report/ReportActionCompose.js
Lines 162 to 175 in 23686e4
I'm thinking about this approach because I would think it is lest costly than unmounting and mounting again.
Update: lol, I had a look again and there is code trying to update the comment if the report changes in ReportActionCompose.componentDidUpdate, I wonder why it is not working 😕
App/src/pages/home/report/ReportActionCompose.js
Lines 181 to 187 in 0694245
Update 2: putting some console logs, by the time the reportID prop changes in ReportActionCompose.componentDidUpdate, the props.comment has not changed yet. I'm guessing that this is because how Onyx works and there is some delay on syncing the props with the data coming from Onyx.
|
This PR will also fix #11860 |
|
|
|
@yuwenmemon looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
|
I'm too fast for you @MelvinBot |
Re-render ReportFooter when transitioning to new chat (cherry picked from commit dc28813)
…-11853 🍒 Cherry pick PR #11853 to staging 🍒
|
🚀 Cherry-picked to staging by @yuwenmemon in version: 1.2.15-3 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
|
🚀 Deployed to production by @yuwenmemon in version: 1.2.15-3 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/AndrewGable in version: 1.3.28-2 🚀
@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes. |
Details
When we are transitioning from one report to another we must unmount the ReportActionsView and ReportFooter. We were only unmounting the ReportActionsView so the composer would show a stale draft.
Fixed Issues
$ #11840
Tests
PR Review Checklist
PR Author Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarhave been tested & I retested again)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)QA Steps
Screenshots
Web
Kapture.2022-10-14.at.10.55.04.mp4
Mobile Web - Chrome
Kapture.2022-10-14.at.10.56.58.mp4
Mobile Web - Safari
Kapture.2022-10-14.at.10.58.10.mp4
Desktop
Kapture.2022-10-14.at.10.55.04.mp4
iOS
Kapture.2022-10-14.at.11.04.32.mp4
Android
Kapture.2022-10-14.at.11.07.07.mp4