From a710374fe9601b0f232c7fd0e0895e253b1072fe Mon Sep 17 00:00:00 2001 From: pdxlocations Date: Wed, 22 Jan 2025 08:20:51 -0800 Subject: [PATCH] refactor notification --- ui/curses_ui.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ui/curses_ui.py b/ui/curses_ui.py index 53356f8..71384ca 100644 --- a/ui/curses_ui.py +++ b/ui/curses_ui.py @@ -8,18 +8,12 @@ import ui.dialog from ui.colors import setup_colors def add_notification(channel_number): - handle_notification(channel_number, add=True) + globals.notifications.add(channel_number) def remove_notification(channel_number): - handle_notification(channel_number, add=False) + globals.notifications.discard(channel_number) channel_win.box() -def handle_notification(channel_number, add=True): - if add: - globals.notifications.add(channel_number) # Add the channel to the notification tracker - else: - globals.notifications.discard(channel_number) # Remove the channel from the notification tracker - def draw_text_field(win, text): win.border() win.addstr(1, 1, text)