Procházet zdrojové kódy

fix: alerts being completely broken

PR 1175 introduced a bug that wasn't caught where alert messages are not
properly assigned. Additionally, the default alert type was "warning"
which is a regression. This commit makes "info" the default alert type
and ensures options.message is the first candidate for the alert message
contents.
KernelDeimos před 2 měsíci
rodič
revize
33a7811e8f
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      src/gui/src/UI/UIAlert.js

+ 2 - 2
src/gui/src/UI/UIAlert.js

@@ -50,8 +50,8 @@ function UIAlert(options) {
         };
 
         // Set default values
-        const alertType = alertTypes[options.type] || alertTypes.warning;
-        options.message = options.title || alertType.title;
+        const alertType = alertTypes[options.type] || alertTypes.info;
+        options.message = options.message || options.title || alertType.title;
         options.body_icon = options.body_icon ?? window.icons[alertType.icon];
         options.color = options.color ?? alertType.color;