battery-service: restored showNotice as it's the only method that support custom icon

This commit is contained in:
Lemmy
2026-02-06 00:32:34 -05:00
parent 6006b2abc4
commit 4a06e2f855
+4 -7
View File
@@ -312,9 +312,9 @@ Singleton {
}
function notify(device, level) {
if (!Settings.data.notifications.enableBatteryToast)
if (!Settings.data.notifications.enableBatteryToast) {
return;
}
var name = getDeviceName(device);
var titleKey = level === "critical" ? "toast.battery.critical" : "toast.battery.low";
var descKey = level === "critical" ? "toast.battery.critical-desc" : "toast.battery.low-desc";
@@ -329,11 +329,8 @@ Singleton {
title = title + " " + name;
}
if (level == "critical") {
ToastService.showError(title, desc, icon);
} else {
ToastService.showWarning(title, desc, icon);
}
// Only 'showNotice' supports custom icons
ToastService.showNotice(title, desc, icon, 6000);
}
Instantiator {