-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix new tab opens when downloading offline #28114
Conversation
src/components/AttachmentModal.js
Outdated
@@ -350,7 +351,7 @@ function AttachmentModal(props) { | |||
<HeaderWithBackButton | |||
title={props.headerTitle || translate(isAttachmentReceipt ? 'common.receipt' : 'common.attachment')} | |||
shouldShowBorderBottom | |||
shouldShowDownloadButton={props.allowDownload && shouldShowDownloadButton && !isAttachmentReceipt} | |||
shouldShowDownloadButton={props.allowDownload && shouldShowDownloadButton && !isAttachmentReceipt && !NetworkStore.isOffline()} |
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.
Let's use network hook for this component.
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 updated my code.
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.
@StevenKKC I think you updated the wrong component. we cant use the hook outside of react component.
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.
Sorry for my confusion. I updated my wrong code.
Reviewer Checklist
Screenshots/VideosMobile Web - ChromeCleanShot.2023-09-25.at.21.18.00.mp4Mobile Web - SafariCleanShot.2023-09-25.at.21.04.14.mp4DesktopCleanShot.2023-09-25.at.21.21.15.mp4iOSCleanShot.2023-09-25.at.21.28.38.mp4AndroidCleanShot.2023-09-25.at.22.35.38.mp4 |
@StevenKKC I think we have an edge case in which a user opens the context menu for an attachment, then goes offline. In this scenario, the context menu is not updated immediately; instead, it will only be updated after the user closes and reopens the context menu. Is it simple to fix this case ? CleanShot.2023-09-26.at.10.08.43.mp4 |
@StevenKKC I think we can pass the offline prop in this line , that should address the above bug : App/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.js Lines 62 to 63 in 85a9c5f
|
We have a lint error. |
@StevenKKC have we addressed this changes #28114 (comment) ? |
Not yet. could you explain in more details? |
Regarding the bug, the context menu does not re-render when the network change . My suggestions, instead of using the App/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.js Lines 62 to 63 in 85a9c5f
|
We have a lint error as well |
Co-authored-by: Fedi Rajhi <[email protected]>
Co-authored-by: Fedi Rajhi <[email protected]>
Co-authored-by: Fedi Rajhi <[email protected]>
Lint error related to Prettier |
@fedirjh I am really sorry about I am out of office. |
I would be appreciate it if you suggest the commit. |
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.
No problem, I have suggested the required changes
src/pages/home/report/ContextMenu/BaseReportActionContextMenu.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Fedi Rajhi <[email protected]>
Co-authored-by: Fedi Rajhi <[email protected]>
Co-authored-by: Fedi Rajhi <[email protected]>
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.
LGTM
✋ 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 by https://github.com/thienlnam in version: 1.3.75-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.75-12 🚀
|
🚀 Deployed to staging by https://github.com/thienlnam in version: 1.3.76-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.76-6 🚀
|
Details
Fixed Issues
$ #26258
PROPOSAL: #26258 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Web.webm
Mobile Web - Chrome
Android-Chrome.webm
Mobile Web - Safari
iOS-Safari.webm
Desktop
Desktop.mp4
iOS
iOS.webm
Android
Android.webm