From c2443ee2c5427504fb30b77a86dfd700f2b126f4 Mon Sep 17 00:00:00 2001
From: AAGaming <aagaming@riseup.net>
Date: Fri, 26 Jul 2024 14:53:41 -0400
Subject: fix(toaster): remove critical toast logic as ProcessNotification
 handles it for us

---
 frontend/src/toaster.tsx | 38 +++++++++++++++-----------------------
 1 file changed, 15 insertions(+), 23 deletions(-)

(limited to 'frontend/src/toaster.tsx')

diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx
index b6b29157..06150b9e 100644
--- a/frontend/src/toaster.tsx
+++ b/frontend/src/toaster.tsx
@@ -67,31 +67,23 @@ class Toaster extends Logger {
     if (toast.playSound === undefined) toast.playSound = true;
     if (toast.showToast === undefined) toast.showToast = true;
     if (toast.timestamp === undefined) toast.timestamp = new Date();
-    if (
-      (window.settingsStore.settings.bDisableAllToasts && !toast.critical) ||
-      (window.settingsStore.settings.bDisableToastsInGame &&
-        !toast.critical &&
-        window.NotificationStore.BIsUserInGame())
-    )
-      return;
-    if (toast.showToast) {
-      function fnTray(toast: any, tray: any) {
-        let group = {
-          eType: toast.eType,
-          notifications: [toast],
-        };
-        tray.unshift(group);
-        // TODO do we need to handle expiration?
-      }
-      const info = {
-        showToast: toast.showToast,
-        sound: toast.sound,
-        eFeature: 0,
-        toastDurationMS: toastData.nToastDurationMS,
-        fnTray,
+    function fnTray(toast: any, tray: any) {
+      let group = {
+        eType: toast.eType,
+        notifications: [toast],
       };
-      window.NotificationStore.ProcessNotification(info, toastData, ToastType.New);
+      tray.unshift(group);
+      // TODO do we need to handle expiration? how do we do that?
     }
+    const info = {
+      showToast: toast.showToast,
+      sound: toast.sound,
+      eFeature: 0,
+      toastDurationMS: toastData.nToastDurationMS,
+      bCritical: toast.critical,
+      fnTray,
+    };
+    window.NotificationStore.ProcessNotification(info, toastData, ToastType.New);
   }
 
   deinit() {
-- 
cgit v1.2.3

