mirror of
https://github.com/bitwarden/android.git
synced 2026-06-09 08:09:16 -05:00
Generator loadPasscodeOptions to include setting defaults (#267)
This commit is contained in:
committed by
Álison Fernandes
parent
e8ae15ddc3
commit
14cfc7493d
@@ -104,20 +104,23 @@ class GeneratorViewModel @Inject constructor(
|
||||
}
|
||||
|
||||
is Password -> {
|
||||
val options = generatorRepository.getPasswordGenerationOptions() ?: return
|
||||
updateGeneratorMainType {
|
||||
Passcode(
|
||||
selectedType = Password(
|
||||
length = options.length,
|
||||
useCapitals = options.hasUppercase,
|
||||
useLowercase = options.hasLowercase,
|
||||
useNumbers = options.hasNumbers,
|
||||
useSpecialChars = options.allowSpecial,
|
||||
minNumbers = options.minNumber,
|
||||
minSpecial = options.minSpecial,
|
||||
avoidAmbiguousChars = options.allowAmbiguousChar,
|
||||
),
|
||||
val options = generatorRepository.getPasswordGenerationOptions()
|
||||
val password = if (options != null) {
|
||||
Password(
|
||||
length = options.length,
|
||||
useCapitals = options.hasUppercase,
|
||||
useLowercase = options.hasLowercase,
|
||||
useNumbers = options.hasNumbers,
|
||||
useSpecialChars = options.allowSpecial,
|
||||
minNumbers = options.minNumber,
|
||||
minSpecial = options.minSpecial,
|
||||
avoidAmbiguousChars = options.allowAmbiguousChar,
|
||||
)
|
||||
} else {
|
||||
Password()
|
||||
}
|
||||
updateGeneratorMainType {
|
||||
Passcode(selectedType = password)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user