diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-11-22 10:04:24 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-11-22 10:05:29 +0000 |
| commit | b5b28fe742423933b1fee5a5f94f276f7cbd0abf (patch) | |
| tree | d06c6e113ce3a99984994f14bf5d19aefee52560 /src/lib | |
| parent | f42da615be7c994581b49ed9d5c17325b904b8f6 (diff) | |
feat(login): exit help with ctrl + c
rather than any key press as `esc` wasn't included as a key press
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/login/fresh.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/login/fresh.rs b/src/lib/login/fresh.rs index bd5837a..b0fbe3f 100644 --- a/src/lib/login/fresh.rs +++ b/src/lib/login/fresh.rs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | use std::{str::FromStr, sync::Arc, time::Duration}; | 1 | use std::{str::FromStr, sync::Arc, time::Duration}; |
| 2 | 2 | ||
| 3 | use anyhow::{bail, Context, Result}; | 3 | use anyhow::{bail, Context, Result}; |
| 4 | use console::{Style, Term}; | 4 | use console::Style; |
| 5 | use dialoguer::theme::{ColorfulTheme, Theme}; | 5 | use dialoguer::theme::{ColorfulTheme, Theme}; |
| 6 | use nostr::nips::{nip05, nip46::NostrConnectURI}; | 6 | use nostr::nips::{nip05, nip46::NostrConnectURI}; |
| 7 | use nostr_connect::client::NostrConnect; | 7 | use nostr_connect::client::NostrConnect; |
| @@ -68,7 +68,7 @@ pub async fn fresh_login_or_signup( | |||
| 68 | continue; | 68 | continue; |
| 69 | } | 69 | } |
| 70 | _ => { | 70 | _ => { |
| 71 | display_login_help_content(); | 71 | display_login_help_content().await; |
| 72 | continue; | 72 | continue; |
| 73 | } | 73 | } |
| 74 | } | 74 | } |
| @@ -566,7 +566,7 @@ fn silently_save_to_git_config( | |||
| 566 | Ok(()) | 566 | Ok(()) |
| 567 | } | 567 | } |
| 568 | 568 | ||
| 569 | fn display_login_help_content() { | 569 | async fn display_login_help_content() { |
| 570 | let mut printer = Printer::default(); | 570 | let mut printer = Printer::default(); |
| 571 | let title_style = Style::new().bold().fg(console::Color::Yellow); | 571 | let title_style = Style::new().bold().fg(console::Color::Yellow); |
| 572 | printer.println("|==============================|".to_owned()); | 572 | printer.println("|==============================|".to_owned()); |
| @@ -583,8 +583,8 @@ fn display_login_help_content() { | |||
| 583 | printer.printlns(vec![ | 583 | printer.printlns(vec![ |
| 584 | "".to_string(), | 584 | "".to_string(), |
| 585 | "login / sign up help content should go here...".to_string(), | 585 | "login / sign up help content should go here...".to_string(), |
| 586 | "press any key to see the login / signup menu again...".to_string(), | 586 | "press ctrl + c to return the login / sign up menu again...".to_string(), |
| 587 | ]); | 587 | ]); |
| 588 | let _ = Term::stdout().read_char(); | 588 | let _ = signal::ctrl_c().await; |
| 589 | printer.clear_all(); | 589 | printer.clear_all(); |
| 590 | } | 590 | } |