Introduce enum for password generator flavour

This commit is contained in:
Danny Moesch 2018-11-28 22:58:24 +01:00 committed by Bob Sun
parent 1f57305203
commit 3cd8df310c
10 changed files with 102 additions and 47 deletions

View file

@ -18,8 +18,7 @@ class EditPasswordTableViewController: PasswordEditorTableViewController {
[[.type: PasswordEditorCellType.scanQRCodeCell],
[.type: PasswordEditorCellType.deletePasswordCell]]
]
if let lengthSetting = Globals.passwordDefaultLength[SharedDefaults[.passwordGeneratorFlavor]],
lengthSetting.max > lengthSetting.min {
if PasswordGeneratorFlavour.from(SharedDefaults[.passwordGeneratorFlavor]) == PasswordGeneratorFlavour.RANDOM {
tableData[1].append([.type: PasswordEditorCellType.passwordLengthCell, .title: "passwordlength"])
}
tableData[1].append([.type: PasswordEditorCellType.memorablePasswordGeneratorCell])