From 99e2b17754e1f594c8bd96598aead2526cdd4504 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Tue, 12 Nov 2024 14:27:10 -0500 Subject: [PATCH] fix(agsV2 notifs): don't render icon if not found --- .../config/widgets/notifs/notification.tsx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/nixosModules/ags-v2/config/widgets/notifs/notification.tsx b/nixosModules/ags-v2/config/widgets/notifs/notification.tsx index e54035dc..363acc23 100644 --- a/nixosModules/ags-v2/config/widgets/notifs/notification.tsx +++ b/nixosModules/ags-v2/config/widgets/notifs/notification.tsx @@ -24,7 +24,7 @@ const setTime = (time: number): string => GLib.DateTime const NotifIcon = ({ notifObj }: { notifObj: AstalNotifd.Notification }) => { - let icon: string; + let icon: string | undefined; if (notifObj.get_image() && notifObj.get_image() !== '') { icon = notifObj.get_image(); @@ -36,7 +36,7 @@ const NotifIcon = ({ notifObj }: { else { icon = Applications.fuzzy_query( notifObj.get_app_name(), - )[0].get_icon_name(); + )[0]?.get_icon_name(); } return ( @@ -48,14 +48,16 @@ const NotifIcon = ({ notifObj }: { min-height: 78px; `} > - + {icon && ( + + )} ); };