From a97b4b010dbc2c32089000d153fea86ac0209e47 Mon Sep 17 00:00:00 2001
From: Stephen Birarda <commit@birarda.com>
Date: Thu, 18 Jan 2018 16:51:28 -0800
Subject: [PATCH] suppress Interface notification for DS decryption error

---
 scripts/system/notifications.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/scripts/system/notifications.js b/scripts/system/notifications.js
index 11c083dacc..728760c1e7 100644
--- a/scripts/system/notifications.js
+++ b/scripts/system/notifications.js
@@ -539,8 +539,14 @@
         return startingUp;
     }
 
-    function onDomainConnectionRefused(reason) {
-        createNotification("Connection refused: " + reason, NotificationType.CONNECTION_REFUSED);
+    function onDomainConnectionRefused(reason, reasonCode) {
+        // the "login error" reason means that the DS couldn't decrypt the username signature
+        // since this eventually resolves itself for good actors we don't need to show a notification for it
+        var LOGIN_ERROR_REASON_CODE = 2;
+
+        if (reasonCode != LOGIN_ERROR_REASON_CODE) {
+            createNotification("Connection refused: " + reason, NotificationType.CONNECTION_REFUSED);
+        }
     }
 
     function onEditError(msg) {