Fix a bug about "discard all changes"

- Show the number of (not pushed) commits discarded.
This commit is contained in:
Yishi Lin 2017-03-07 01:43:23 +08:00
parent 0dccd911fd
commit c131de0551
2 changed files with 8 additions and 8 deletions

View file

@ -40,10 +40,10 @@ class AdvancedSettingsTableViewController: UITableViewController {
SVProgressHUD.show(withStatus: "Resetting ...")
DispatchQueue.main.async {
do {
try PasswordStore.shared.reset()
let numberDiscarded = try PasswordStore.shared.reset()
NotificationCenter.default.post(Notification(name: Notification.Name("passwordStoreChangeDiscarded")))
self.navigationController!.popViewController(animated: true)
SVProgressHUD.showSuccess(withStatus: "Done")
SVProgressHUD.showSuccess(withStatus: "Discarded \(numberDiscarded) commits")
SVProgressHUD.dismiss(withDelay: 1)
} catch {
DispatchQueue.main.async {