Fix crash when deleting draft

Closes #94
This commit is contained in:
Shadowfacts 2020-03-11 22:18:31 -04:00
parent b232bec80f
commit fadddeda7f
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 1 additions and 0 deletions

View File

@ -102,6 +102,7 @@ class DraftsTableViewController: UITableViewController {
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
guard editingStyle == .delete else { return }
DraftsManager.shared.remove(draft(for: indexPath))
drafts.remove(at: indexPath.row)
tableView.deleteRows(at: [indexPath], with: .automatic)
}