Преглед изворни кода

Only show WebRTC troubleshooting tips when appropriate (#625)

When the relayed data task is active, these hints don't make sense.
Danilo Bargen пре 6 година
родитељ
комит
974f93eea0
2 измењених фајлова са 9 додато и 2 уклоњено
  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>
                                 <span translate>troubleshooting.SESSION_DELETED</span>
                             </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>
                                 <span translate>troubleshooting.PLUGIN</span>
                             </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>
                                 <span translate>troubleshooting.ADBLOCKER</span>
                             </li>

+ 7 - 0
src/partials/welcome.ts

@@ -247,6 +247,13 @@ class WelcomeController {
         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.
      */