瀏覽代碼

show not connected instead of a green bullet point in notifications entry if app has no internet connectivity

cyberta 3 年之前
父節點
當前提交
8990e4ffea
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      deltachat-ios/Controller/ConnectivityViewController.swift

+ 2 - 1
deltachat-ios/Controller/ConnectivityViewController.swift

@@ -43,6 +43,7 @@ class ConnectivityViewController: WebViewViewController {
 
     // this method needs to be run from a background thread
     private func getNotificationStatus(hasNotifyToken: Bool, backgroundRefreshStatus: UIBackgroundRefreshStatus) -> String {
+        let connectiviy = self.dcContext.getConnectivity()
         let title = " <b>" + String.localized("pref_notifications") + ":</b> "
         let notificationsEnabledInDC = !UserDefaults.standard.bool(forKey: "notifications_disabled")
         var notificationsEnabledInSystem = false
@@ -77,7 +78,7 @@ class ConnectivityViewController: WebViewViewController {
                 .appending(String.localized("bg_app_refresh_disabled"))
         }
 
-        if !hasNotifyToken {
+        if !hasNotifyToken || connectiviy == DC_CONNECTIVITY_NOT_CONNECTED {
             return "<span class=\"red dot\"></span>"
                 .appending(title)
                 .appending(String.localized("connectivity_not_connected"))