Make Add Folder remember last selected Account. Issue #1303

This commit is contained in:
Maurice Parker
2019-11-16 15:28:57 -06:00
parent 1b13c0e589
commit 901ac3b6aa

View File

@@ -37,6 +37,11 @@ class AddFolderViewController: UITableViewController, AddContainerViewController
if shouldDisplayPicker {
accountPickerView.dataSource = self
accountPickerView.delegate = self
if let index = accounts.firstIndex(where: { $0.accountID == AppDefaults.addFolderAccountID }) {
accountPickerView.selectRow(index, inComponent: 0, animated: false)
}
} else {
accountPickerView.isHidden = true
}
@@ -96,6 +101,7 @@ extension AddFolderViewController: UIPickerViewDataSource, UIPickerViewDelegate
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
accountLabel.text = (accounts[row] as DisplayNameProvider).nameForDisplay
AppDefaults.addFolderAccountID = accounts[row].accountID
}
}