Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ jobs:
- run: rustup default ${{ matrix.rustup }}
- run: |
cargo install --path . --force
if: matrix.os == 'windows-latest' && matrix.rustup == 'nightly'
#if: matrix.os == 'windows-latest' && matrix.rustup == 'nightly'
- run: |
make cargo-install || sudo make cargo-install
if: matrix.os != 'windows-latest' && matrix.rustup == 'nightly'
#if: matrix.os != 'windows-latest' && matrix.rustup == 'nightly'
- run: V=1 sudo make docs || true
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true && matrix.os == 'ubuntu-matrix'

Expand Down
55 changes: 41 additions & 14 deletions src/lib/chat/ui.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use crate::blockheight::blockheight_sync;
use crate::chat::msg;
use crate::weeble::weeble_sync;
use crate::wobble::wobble_sync;
use ratatui::{
backend::{Backend, CrosstermBackend},
crossterm::{
Expand All @@ -15,6 +17,7 @@ use ratatui::{
};

use std::{
env,
error::Error,
io,
sync::{Arc, Mutex},
Expand Down Expand Up @@ -134,6 +137,9 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: &mut App) -> io::Result<
terminal.draw(|f| ui(f, &app))?;

if !event::poll(tick_rate)? {
//env::set_var("BLOCKHEIGHT", blockheight_sync());
env::set_var("WEEBLE", weeble_sync().unwrap().to_string());
env::set_var("WOBBLE", wobble_sync().unwrap().to_string());
continue;
}

Expand Down Expand Up @@ -181,7 +187,13 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: &mut App) -> io::Result<
//TODO refresh and query topic nostr DMs
let m = msg::Msg::default() //default Msg type Chat
.set_content(
"</> forward slash modal trigger".to_string(),
format!(
"{}/{}/{}>{}",
&env::var("WEEBLE").unwrap(),
&env::var("BLOCKHEIGHT").unwrap(),
&env::var("WOBBLE").unwrap(),
"</>".to_string()
),
0 as usize,
);
app.add_message(m.clone());
Expand All @@ -203,7 +215,13 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: &mut App) -> io::Result<
//TODO refresh and query topic nostr DMs
let m = msg::Msg::default() //default Msg type Chat
.set_content(
"<\\> back slash modal trigger".to_string(),
format!(
"{}/{}/{}>{}",
&env::var("WEEBLE").unwrap(),
&env::var("BLOCKHEIGHT").unwrap(),
&env::var("WOBBLE").unwrap(),
"<\\>".to_string()
),
0 as usize,
);
app.add_message(m.clone());
Expand All @@ -223,12 +241,17 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: &mut App) -> io::Result<
}
} else {
//TODO refresh and query topic nostr DMs
let m =
msg::Msg::default() //default Msg type Chat
.set_content(
"<:> vim like command prompt".to_string(),
0 as usize,
);
let m = msg::Msg::default() //default Msg type Chat
.set_content(
format!(
"{}/{}/{}>{}",
&env::var("WEEBLE").unwrap(),
&env::var("BLOCKHEIGHT").unwrap(),
&env::var("WOBBLE").unwrap(),
"<:>".to_string()
),
0 as usize,
);
app.add_message(m.clone());
if let Some(ref mut hook) = app._on_input_enter {
hook(m);
Expand Down Expand Up @@ -268,9 +291,11 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: &mut App) -> io::Result<
//TODO refresh and query topic nostr DMs
let m = msg::Msg::default().set_content(
format!(
"{}:{}",
&blockheight_sync(),
"test message <ENTER>".to_string()
"{}/{}/{}>{}",
&env::var("WEEBLE").unwrap(),
&env::var("BLOCKHEIGHT").unwrap(),
&env::var("WOBBLE").unwrap(),
"<ENTER>".to_string()
),
0 as usize,
);
Expand All @@ -287,9 +312,11 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: &mut App) -> io::Result<
app.input.reset();
let m = msg::Msg::default().set_content(
format!(
"{}:{}",
&blockheight_sync(),
"<test message ESC>".to_string()
"{}/{}/{}>{}",
&env::var("WEEBLE").unwrap(),
&env::var("BLOCKHEIGHT").unwrap(),
&env::var("WOBBLE").unwrap(),
"<ESC>".to_string()
),
0 as usize,
);
Expand Down
Loading