Jelajahi Sumber

Merge pull request #805 from deltachat/watch-restart-io

restart-io when watch-settings are changed
bjoern 5 tahun lalu
induk
melakukan
2e63032226
1 mengubah file dengan 6 tambahan dan 0 penghapusan
  1. 6 0
      deltachat-ios/Controller/AccountSetupController.swift

+ 6 - 0
deltachat-ios/Controller/AccountSetupController.swift

@@ -262,7 +262,9 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
             textLabel: String.localized("pref_watch_inbox_folder"),
             on: dcContext.getConfigBool("inbox_watch"),
             action: { cell in
+                self.dcContext.stopIo()
                 self.dcContext.setConfigBool("inbox_watch", cell.isOn)
+                self.dcContext.maybeStartIo()
         })
     }()
 
@@ -271,7 +273,9 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
             textLabel: String.localized("pref_watch_sent_folder"),
             on: dcContext.getConfigBool("sentbox_watch"),
             action: { cell in
+                self.dcContext.stopIo()
                 self.dcContext.setConfigBool("sentbox_watch", cell.isOn)
+                self.dcContext.maybeStartIo()
         })
     }()
 
@@ -280,7 +284,9 @@ class AccountSetupController: UITableViewController, ProgressAlertHandler {
             textLabel: String.localized("pref_watch_mvbox_folder"),
             on: dcContext.getConfigBool("mvbox_watch"),
             action: { cell in
+                self.dcContext.stopIo()
                 self.dcContext.setConfigBool("mvbox_watch", cell.isOn)
+                self.dcContext.maybeStartIo()
         })
     }()