Skip to content

Commit

Permalink
Don't check for actions, put try in a else block
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 committed Aug 24, 2023
1 parent 2905d1b commit d7176ca
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/Widgets/NotificationsList.vala
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,15 @@ public class Notifications.NotificationsList : Gtk.ListBox {
if (notification_entry.notification.default_action != null) {
unowned var action_group = get_action_group (ACTION_GROUP_PREFIX);
action_group.activate_action (notification_entry.notification.default_action, null);
} else if (notification_entry.notification.actions.length > 0) {
return;
}

try {
notification_entry.notification.app_info.launch (null, null);

notification_entry.clear ();
close_popover ();
} catch (Error e) {
warning ("Unable to launch app: %s", e.message);
} else {
try {
notification_entry.notification.app_info.launch (null, null);
notification_entry.clear ();
close_popover ();
} catch (Error e) {
warning ("Unable to launch app: %s", e.message);
}
}
}
}
Expand Down

0 comments on commit d7176ca

Please sign in to comment.