From 006af1ab790d640f25f7f6eef7ea6970cfc44c4d Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Fri, 6 Sep 2019 17:09:28 -0400 Subject: [PATCH] Save status draft while posting to prevent data loss due to crashes Closes #33 --- Tusker/Screens/Compose/ComposeViewController.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tusker/Screens/Compose/ComposeViewController.swift b/Tusker/Screens/Compose/ComposeViewController.swift index 2013bde9b8..8700ab983e 100644 --- a/Tusker/Screens/Compose/ComposeViewController.swift +++ b/Tusker/Screens/Compose/ComposeViewController.swift @@ -431,6 +431,9 @@ class ComposeViewController: UIViewController { guard let text = statusTextView.text, !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 postBarButtonItem.isEnabled = false