diff --git a/CHANGES.md b/CHANGES.md index 5a37c86b268..b2259f10f4b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -15,6 +15,7 @@ Bugfix 🐛: - Manual import of Megolm keys does back up the imported keys - Auto scrolling to the latest message when sending (#2094) - Fix incorrect permission check when creating widgets (#2137) + - Pin code: user has to enter pin code twice (#2005) Translations 🗣: - diff --git a/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt b/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt index 91255cd492a..81f73556a55 100644 --- a/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt +++ b/vector/src/main/java/im/vector/app/core/platform/VectorBaseActivity.kt @@ -320,10 +320,15 @@ abstract class VectorBaseActivity : AppCompatActivity(), HasScreenInjector { Activity.RESULT_OK -> { Timber.v("Pin ok, unlock app") pinLocker.unlock() + + // Cancel any new started PinActivity, after a screen rotation for instance + finishActivity(PinActivity.PIN_REQUEST_CODE) } else -> { - // Remove the task, to be sure that PIN code will be requested when resumed - finishAndRemoveTask() + if (pinLocker.getLiveState().value != PinLocker.State.UNLOCKED) { + // Remove the task, to be sure that PIN code will be requested when resumed + finishAndRemoveTask() + } } } }