fix: no escribia las notificaciones con la primera cadena vacía

This commit is contained in:
2024-09-15 17:40:39 +02:00
parent 891d5a8f5e
commit b6c5d06246

View File

@@ -150,12 +150,6 @@ void Notify::clearFinishedNotifications()
// Muestra una notificación de texto por pantalla;
void Notify::showText(std::string text1, std::string text2, int icon)
{
// Si no hay texto, acaba
if (text1 == "" && text2 == "")
{
return;
}
// Cuenta el número de textos a mostrar
int numTexts = 0;
if (text1 != "")
@@ -163,6 +157,18 @@ void Notify::showText(std::string text1, std::string text2, int icon)
if (text2 != "")
numTexts++;
// Si no hay texto, acaba
if (numTexts == 0)
{
return;
}
// Si solo hay un texto, lo coloca en la primera variable
else if (numTexts == 1)
{
text1 = text1 + text2;
text2 = "";
}
// Si las notificaciones no se apilan, elimina las anteriores
if (!stack)
{