Kaynağa Gözat

Check for desktop notifications in troubleshooting tool (#150)

Danilo Bargen 8 yıl önce
ebeveyn
işleme
3a6eb22b07
2 değiştirilmiş dosya ile 21 ekleme ve 0 silme
  1. 14 0
      troubleshoot/index.html
  2. 7 0
      troubleshoot/troubleshoot.js

+ 14 - 0
troubleshoot/index.html

@@ -171,6 +171,20 @@
             </div>
         </div>
 
+        <h2>Are desktop notifications available?</h2>
+        <div id="status-dn">
+            <div class="status status-unknown">
+                <i class="material-icons md-36">help</i> <span class="text">Unknown</span>
+            </div>
+            <div class="status status-no hidden">
+                <i class="material-icons md-36">error</i> <span class="text">No</span>
+                <p class="small">Without desktop notifications, we cannot notify you when a new message arrives.</p>
+            </div>
+            <div class="status status-yes hidden">
+                <i class="material-icons md-36">check_circle</i> <span class="text">Yes</span>
+            </div>
+        </div>
+
         <h2>Does TURN work?</h2>
         <div id="status-turn">
             <div class="status status-unknown">

+ 7 - 0
troubleshoot/troubleshoot.js

@@ -49,6 +49,13 @@ function doChecks() {
         switchTo('ls', 'no');
     }
 
+    // Check for desktop notifications
+    if ('Notification' in window) {
+        switchTo('dn', 'yes');
+    } else {
+        switchTo('dn', 'no');
+    }
+
     // Check for TURN connectivity
     var timeout = null;
     function turnSuccess() {