Browse Source

Only show WebRTC troubleshooting tips when appropriate (#625)

When the relayed data task is active, these hints don't make sense.
Danilo Bargen 6 years ago
parent
commit
974f93eea0
2 changed files with 9 additions and 2 deletions
  1. 2 2
      src/partials/welcome.html
  2. 7 0
      src/partials/welcome.ts

+ 2 - 2
src/partials/welcome.html

@@ -91,11 +91,11 @@
                                 <i class="material-icons md-dark md-14">help</i>
                                 <i class="material-icons md-dark md-14">help</i>
                                 <span translate>troubleshooting.SESSION_DELETED</span>
                                 <span translate>troubleshooting.SESSION_DELETED</span>
                             </li>
                             </li>
-                            <li ng-if="ctrl.state === 'peer_handshake'">
+                            <li ng-if="ctrl.state === 'peer_handshake' && ctrl.showWebrtcTroubleshooting">
                                 <i class="material-icons md-dark md-14">help</i>
                                 <i class="material-icons md-dark md-14">help</i>
                                 <span translate>troubleshooting.PLUGIN</span>
                                 <span translate>troubleshooting.PLUGIN</span>
                             </li>
                             </li>
-                            <li ng-if="ctrl.state === 'peer_handshake'">
+                            <li ng-if="ctrl.state === 'peer_handshake' && ctrl.showWebrtcTroubleshooting">
                                 <i class="material-icons md-dark md-14">help</i>
                                 <i class="material-icons md-dark md-14">help</i>
                                 <span translate>troubleshooting.ADBLOCKER</span>
                                 <span translate>troubleshooting.ADBLOCKER</span>
                             </li>
                             </li>

+ 7 - 0
src/partials/welcome.ts

@@ -247,6 +247,13 @@ class WelcomeController {
         return this.stateService.slowConnect;
         return this.stateService.slowConnect;
     }
     }
 
 
+    /**
+     * Whether to show troubleshooting hints related to WebRTC.
+     */
+    public get showWebrtcTroubleshooting(): boolean {
+        return this.webClientService.chosenTask === threema.ChosenTask.WebRTC;
+    }
+
     /**
     /**
      * Initiate a new session by scanning a new QR code.
      * Initiate a new session by scanning a new QR code.
      */
      */