index : nmrs-tui
A fast, Vim-friendly NetworkManager TUI built in Rust.
about summary refs log tree commit diff

Diffstat (limited to 'src/tui.rs')

-rw-r--r-- src/tui.rs 18
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/tui.rs b/src/tui.rs
index a78e6e8..bfb5d88 100644
--- a/src/tui.rs
+++ b/src/tui.rs
@@ -14,7 +14,7 @@
use tokio_stream::StreamExt;

use crate::{
    action::{Action, ActionHandler},
    action::{Action, ActionHandler, ToastRequest},
    app::{App, Focus, Popups, Selected},
    events,
    ui::{
@@ -64,14 +64,14 @@
                maybe_event = reader.next() => {
                    if let Some(Ok(Event::Key(key))) = maybe_event {
                        events::handle_events(app, key).await?;
                        info!("Event: {:?}!", key);
                        debug!("Event: {:?}!", key);
                        self.should_render = true;
                    }
                }

                // Render when there no action or event
                _ = time::sleep(tick_rate.saturating_sub(last_tick.elapsed())) => {
                    info!("Ticks!");
                    debug!("Ticks!");
                    self.should_render = true;
                }
            }
@@ -113,12 +113,12 @@
                    if let Some(Selected::Network(net)) = app.selected() {
                        popup::draw_auth(f, &app.input, net, &app.config.ui.password_popup)
                    } else {
                        app.action.send(Action::ShowToast(
                            None,
                            "Can't find selected network".into(),
                            Urgency::Critical,
                            None,
                        ));
                        app.action.send(Action::ShowToast(Box::new(ToastRequest {
                            title: None,
                            msg: "Can't find selected network".into(),
                            urgency: Urgency::Critical,
                            duration: None,
                        })));
                        app.action.send(Action::SetFocus(app.last_focus));
                    }
                }