This repository was archived by the owner on Nov 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
app/src/main/java/eu/seldon1000/nextpass Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,6 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
231
231
232
232
fun lock (shouldRaiseBiometric : Boolean = true) {
233
233
if (pinProtected.value) {
234
- unlocked = false
235
234
biometricDismissed.value = false
236
235
dismissDialog()
237
236
@@ -243,17 +242,16 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
243
242
}
244
243
245
244
fun unlock (pin : String = "") {
246
- if (! unlocked && pin.isNotEmpty() &&
247
- pin != sharedPreferences.getString(" PIN" , null )
248
- ) showDialog(
249
- title = context.getString(R .string.wrong_pin),
250
- body = {
251
- Text (
252
- text = context.getString(R .string.wrong_pin_body),
253
- fontSize = 14 .sp
254
- )
255
- }
256
- )
245
+ if (pin.isNotEmpty() && pin != sharedPreferences.getString(" PIN" , null ))
246
+ showDialog(
247
+ title = context.getString(R .string.wrong_pin),
248
+ body = {
249
+ Text (
250
+ text = context.getString(R .string.wrong_pin_body),
251
+ fontSize = 14 .sp
252
+ )
253
+ }
254
+ )
257
255
258
256
unlocked = unlocked || pin == sharedPreferences.getString(" PIN" , null )
259
257
@@ -264,7 +262,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
264
262
pendingUnlockAction!! ()
265
263
pendingUnlockAction = null
266
264
} else executeRequest { nextcloudApi.refreshServerList() }
267
- } else lock()
265
+ } else if (pin.isEmpty()) lock()
268
266
}
269
267
270
268
fun changePin () {
You can’t perform that action at this time.
0 commit comments