File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ const ProfileView = ({ navigation }: IProfileViewProps): React.ReactElement => {
155155 showActionSheet ( { children : < DeleteAccountActionSheetContent /> } ) ;
156156 } ;
157157
158+ // TODO: function is too long, split it
158159 const submit = async ( ) : Promise < void > => {
159160 Keyboard . dismiss ( ) ;
160161
@@ -213,6 +214,21 @@ const ProfileView = ({ navigation }: IProfileViewProps): React.ReactElement => {
213214 const user = { ...getValues ( ) , ...params } ;
214215 Object . entries ( user ) . forEach ( ( [ key , value ] ) => setValue ( key as any , value ) ) ;
215216 }
217+
218+ const updatedUser = {
219+ ...user ,
220+ ...params
221+ } ;
222+
223+ reset ( {
224+ name : updatedUser . name || '' ,
225+ username : updatedUser . username || '' ,
226+ email : updatedUser . emails ?. [ 0 ] ?. address || updatedUser . email || '' ,
227+ currentPassword : null ,
228+ bio : updatedUser . bio || '' ,
229+ nickname : updatedUser . nickname || '' ,
230+ saving : false
231+ } ) ;
216232 dispatch ( setUser ( { ...user , ...params , customFields } ) ) ;
217233 EventEmitter . emit ( LISTENER , { message : I18n . t ( 'Profile_saved_successfully' ) } ) ;
218234 }
You can’t perform that action at this time.
0 commit comments