-
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
fix: 16528 upload gif image fluctuate #17454
Changes from 3 commits
8282225
db6cfbf
b05be87
ef16bed
92b60d7
ed4470a
40bc8b0
2e06be8
63e7599
19780e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -289,11 +289,13 @@ function updateAvatar(file) { | |||||
[currentUserEmail]: { | ||||||
avatar: file.uri, | ||||||
avatarThumbnail: file.uri, | ||||||
avatarFileName: file.name, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
errorFields: { | ||||||
avatar: null, | ||||||
}, | ||||||
pendingFields: { | ||||||
avatar: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE, | ||||||
avatarFileName: null, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
}, | ||||||
}, | ||||||
}, | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -130,6 +130,7 @@ class DetailsPage extends React.PureComponent { | |||||
headerTitle={isSMSLogin ? this.props.toLocalPhone(details.displayName) : details.displayName} | ||||||
source={ReportUtils.getFullSizeAvatar(details.avatar, details.login)} | ||||||
isAuthTokenRequired | ||||||
originalFileName={details.avatarFileName} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
> | ||||||
{({show}) => ( | ||||||
<PressableWithoutFocus | ||||||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -196,14 +196,12 @@ function getZoomCursorStyle(isZoomed, isDragging) { | |||||||
* @param {Number} zoomScale | ||||||||
* @param {Number} containerHeight | ||||||||
* @param {Number} containerWidth | ||||||||
* @return {Object} | ||||||||
* @param {Boolean} isLoading | ||||||||
* @return {Object | undefined} | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to our style guide:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @eVoloshchak . I know but I still see other place use type unions: Line 396 in 74d5290
I don't actually know the best way to do here. What is your thought? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I think it's acceptable in this case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
*/ | ||||||||
function getZoomSizingStyle(isZoomed, imgWidth, imgHeight, zoomScale, containerHeight, containerWidth) { | ||||||||
if (imgWidth === 0 || imgHeight === 0) { | ||||||||
return { | ||||||||
height: isZoomed ? '250%' : '100%', | ||||||||
width: isZoomed ? '250%' : '100%', | ||||||||
}; | ||||||||
function getZoomSizingStyle(isZoomed, imgWidth, imgHeight, zoomScale, containerHeight, containerWidth, isLoading) { | ||||||||
if (isLoading || imgWidth === 0 || imgHeight === 0) { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
return undefined; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Or if we have to return There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @eVoloshchak I prefer using undefined. I tested all platforms with undefined and I believe it works well. And changing |
||||||||
} | ||||||||
const top = `${Math.max((containerHeight - imgHeight) / 2, 0)}px`; | ||||||||
const left = `${Math.max((containerWidth - imgWidth) / 2, 0)}px`; | ||||||||
|
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 want to change this line because it can improve the performance a bit. isLoading is always set to true then false when image is loaded.
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.
Yeah, I agree, it should be set to true initially
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.
Is this ready for testing?