From b8201381116178e3e308b7180a0baf99c5de95e9 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 29 Aug 2023 11:34:41 +0700 Subject: [PATCH 1/4] Clear the error when going back from other menus --- src/components/AvatarWithImagePicker.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/AvatarWithImagePicker.js b/src/components/AvatarWithImagePicker.js index aa50d6db574b..f1969f045554 100644 --- a/src/components/AvatarWithImagePicker.js +++ b/src/components/AvatarWithImagePicker.js @@ -129,6 +129,9 @@ class AvatarWithImagePicker extends React.Component { } componentDidUpdate(prevProps) { + if (!prevProps.isFocused && this.props.isFocused) { + this.setError(null, {}); + } if (!prevProps.isUploading && this.props.isUploading) { this.animation.start(); } else if (prevProps.isUploading && !this.props.isUploading) { From 4cf570f2c19b183c9673c9c8f0f9a504a423ec58 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 29 Aug 2023 11:39:00 +0700 Subject: [PATCH 2/4] import withNavigationFocus --- src/components/AvatarWithImagePicker.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/AvatarWithImagePicker.js b/src/components/AvatarWithImagePicker.js index f1969f045554..56b701489d22 100644 --- a/src/components/AvatarWithImagePicker.js +++ b/src/components/AvatarWithImagePicker.js @@ -23,6 +23,8 @@ import getImageResolution from '../libs/fileDownload/getImageResolution'; import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback'; import DotIndicatorMessage from './DotIndicatorMessage'; import * as Browser from '../libs/Browser'; +import withNavigationFocus from './withNavigationFocus'; +import compose from '../libs/compose'; const propTypes = { /** Avatar source to display */ @@ -353,4 +355,7 @@ class AvatarWithImagePicker extends React.Component { AvatarWithImagePicker.propTypes = propTypes; AvatarWithImagePicker.defaultProps = defaultProps; -export default withLocalize(AvatarWithImagePicker); +export default compose( + withLocalize, + withNavigationFocus +)(AvatarWithImagePicker); From dc7e813bdaf0fe86cd386c9645e8ed6427b93152 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 29 Aug 2023 12:54:28 +0700 Subject: [PATCH 3/4] fix lint --- src/components/AvatarWithImagePicker.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/AvatarWithImagePicker.js b/src/components/AvatarWithImagePicker.js index 56b701489d22..d6da399962b5 100644 --- a/src/components/AvatarWithImagePicker.js +++ b/src/components/AvatarWithImagePicker.js @@ -355,7 +355,4 @@ class AvatarWithImagePicker extends React.Component { AvatarWithImagePicker.propTypes = propTypes; AvatarWithImagePicker.defaultProps = defaultProps; -export default compose( - withLocalize, - withNavigationFocus -)(AvatarWithImagePicker); +export default compose(withLocalize, withNavigationFocus)(AvatarWithImagePicker); From 4e443a926847b36af2ded772555d9c3e67a7ad58 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Fri, 1 Sep 2023 02:41:52 +0700 Subject: [PATCH 4/4] add proptypes --- src/components/AvatarWithImagePicker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/AvatarWithImagePicker.js b/src/components/AvatarWithImagePicker.js index d6da399962b5..3a43ede5a8f4 100644 --- a/src/components/AvatarWithImagePicker.js +++ b/src/components/AvatarWithImagePicker.js @@ -23,7 +23,7 @@ import getImageResolution from '../libs/fileDownload/getImageResolution'; import PressableWithoutFeedback from './Pressable/PressableWithoutFeedback'; import DotIndicatorMessage from './DotIndicatorMessage'; import * as Browser from '../libs/Browser'; -import withNavigationFocus from './withNavigationFocus'; +import withNavigationFocus, {withNavigationFocusPropTypes} from './withNavigationFocus'; import compose from '../libs/compose'; const propTypes = { @@ -82,6 +82,7 @@ const propTypes = { errors: PropTypes.object, ...withLocalizePropTypes, + ...withNavigationFocusPropTypes, }; const defaultProps = {