Skip to content

Commit 0488c1b

Browse files
illegal state fixed while changing password
1 parent 9996507 commit 0488c1b

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

app/src/main/java/com/github/code/gambit/repositories/profile/ProfileRepositoryImpl.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.github.code.gambit.repositories.profile
22

33
import com.amazonaws.AmazonClientException
44
import com.amazonaws.services.cognitoidentityprovider.model.InvalidParameterException
5+
import com.amazonaws.services.cognitoidentityprovider.model.LimitExceededException
56
import com.github.code.gambit.data.model.User
67
import com.github.code.gambit.data.remote.NetworkDataSource
78
import com.github.code.gambit.data.remote.services.auth.AuthService
@@ -57,6 +58,9 @@ constructor(
5758
val result = authService.resetPassword(oldPassword, newPassword)
5859
if (result is ServiceResult.Error) {
5960
when (result.exception.cause) {
61+
is LimitExceededException -> {
62+
ServiceResult.Error(result.exception)
63+
}
6064
is InvalidParameterException -> {
6165
ServiceResult.Error(Exception("Invalid old password"))
6266
}

app/src/main/java/com/github/code/gambit/ui/fragment/profile/ProfileFragment.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ class ProfileFragment : Fragment(R.layout.fragment_profile) {
109109
binding.changePasswordButton.setOnClickListener(changePasswordListener2)
110110
}
111111
changePasswordListener2 = View.OnClickListener {
112-
binding.changePasswordButton.text = getString(R.string.change_password)
113-
114112
val oldPassword = binding.oldPassword.editText!!.text.toString().trim()
115113
val newPassword = binding.newPassword.editText!!.text.toString().trim()
116114
if (!isValidatePassword(oldPassword, newPassword)) {

app/src/main/res/values/themes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@
160160
<item name="android:textAllCaps">true</item>
161161
<item name="android:textSize">12sp</item>
162162
<item name="android:textColor">@color/secondary</item>
163+
<item name="android:textAlignment">center</item>
163164
</style>
164165

165166
<style name="ShapeAppearance.App.SmallComponent" parent="ShapeAppearance.MaterialComponents.SmallComponent">

0 commit comments

Comments
 (0)