vcard_tui 0.1.2

Terminal UI application for managing vCard contacts.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crossterm::event::{Event, KeyCode};

use crate::state::popup::PopupState;
use crate::State;

pub fn handle_popup_message(event: &Event, state: &mut State) -> anyhow::Result<()> {
    if let Some(PopupState::Message(_)) = state.popup.as_mut() {
        if let Event::Key(key_event) = event {
            if key_event.code == KeyCode::Enter {
                state.popup = None;
            }
        }
    }
    Ok(())
}