Pārlūkot izejas kodu

iOS: Status bar should stay green on connection loss

On iOS connection loss is expected and normal. So the status bar should
stay green, in order not to confuse any people.

The small dot next to the logo will still indicate the real connection
status though (yellow during reconnecting).
Danilo Bargen 7 gadi atpakaļ
vecāks
revīzija
1dae4aa088
3 mainītis faili ar 13 papildinājumiem un 7 dzēšanām
  1. 1 1
      src/controllers/status.ts
  2. 9 3
      src/sass/sections/_status_bar.scss
  3. 3 3
      src/threema.d.ts

+ 1 - 1
src/controllers/status.ts

@@ -84,7 +84,7 @@ export class StatusController {
      * Return the prefixed status.
      */
     public get statusClass(): string {
-        return 'status-' + this.state;
+        return 'status-task-' + this.webClientService.chosenTask + ' status-' + this.state;
     }
 
     /**

+ 9 - 3
src/sass/sections/_status_bar.scss

@@ -45,6 +45,7 @@ body {
         }
     }
 }
+
 .status-ok {
     #status-bar {
         background-color: $status-ok;
@@ -56,9 +57,6 @@ body {
 }
 
 .status-warning {
-    //#main {
-    //    border-top: 5px solid $status-warning;
-    //}
     #status-bar {
         background-color: $status-warning;
     }
@@ -77,6 +75,14 @@ body {
     }
 }
 
+// Use green warning-color for the status bar when using
+// the relayed data task (because connection loss on iOS is expected).
+.status-task-relayed-data {
+    &.status-warning #status-bar {
+        background-color: $status-ok;
+    }
+}
+
 #expanded-status-bar {
     display: flex;
     flex-direction: row;

+ 3 - 3
src/threema.d.ts

@@ -731,9 +731,9 @@ declare namespace threema {
     }
 
     const enum ChosenTask {
-        None,
-        WebRTC,
-        RelayedData,
+        None = 'none',
+        WebRTC = 'webrtc',
+        RelayedData = 'relayed-data',
     }
 
     interface DisconnectMessage {