lets call the handleDeletePasswordProtection callback only at success

This commit is contained in:
tibbi 2018-10-30 23:07:38 +01:00
parent 6bb16f10f1
commit 85d06c3742
2 changed files with 6 additions and 4 deletions

View file

@ -7,7 +7,7 @@ buildscript {
propMinSdkVersion = 21
propTargetSdkVersion = propCompileSdkVersion
propVersionCode = 1
propVersionName = '5.2.17'
propVersionName = '5.2.18'
kotlin_version = '1.2.71'
}

View file

@ -740,13 +740,15 @@ fun Activity.handleAppPasswordProtection(callback: (success: Boolean) -> Unit) {
}
}
fun Activity.handleDeletePasswordProtection(callback: (success: Boolean) -> Unit) {
fun Activity.handleDeletePasswordProtection(callback: () -> Unit) {
if (baseConfig.isDeletePasswordProtectionOn) {
SecurityDialog(this, baseConfig.deletePasswordHash, baseConfig.deleteProtectionType) { hash, type, success ->
callback(success)
if (success) {
callback()
}
}
} else {
callback(true)
callback()
}
}