Save status draft while posting to prevent data loss due to crashes

Closes #33
This commit is contained in:
Shadowfacts 2019-09-06 17:09:28 -04:00
parent d9abf3ec09
commit 006af1ab79
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 3 additions and 0 deletions

View File

@ -431,6 +431,9 @@ class ComposeViewController: UIViewController {
guard let text = statusTextView.text, guard let text = statusTextView.text,
!text.isEmpty else { return } !text.isEmpty else { return }
// save a draft before posting the status, so if a crash occurs during posting, the status won't be lost
saveDraft()
// disable post button while sending post request // disable post button while sending post request
postBarButtonItem.isEnabled = false postBarButtonItem.isEnabled = false