Skip to content

Commit

Permalink
refactor: rebased and removed custom rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandSherwin authored and jacderida committed May 1, 2024
1 parent 02eef0c commit a4efbee
Show file tree
Hide file tree
Showing 11 changed files with 283 additions and 334 deletions.
152 changes: 0 additions & 152 deletions node-launchpad/.github/workflows/cd.yml

This file was deleted.

63 changes: 0 additions & 63 deletions node-launchpad/.github/workflows/ci.yml

This file was deleted.

16 changes: 0 additions & 16 deletions node-launchpad/.rustfmt.toml

This file was deleted.

5 changes: 4 additions & 1 deletion node-launchpad/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
// permissions and limitations relating to use of the SAFE Network Software.

fn main() -> Result<(), Box<dyn std::error::Error>> {
vergen::EmitBuilder::builder().all_build().all_git().emit()?;
vergen::EmitBuilder::builder()
.all_build()
.all_git()
.emit()?;
Ok(())
}
32 changes: 20 additions & 12 deletions node-launchpad/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ impl App {
pub async fn run(&mut self) -> Result<()> {
let (action_tx, mut action_rx) = mpsc::unbounded_channel();

let mut tui = tui::Tui::new()?.tick_rate(self.tick_rate).frame_rate(self.frame_rate);
let mut tui = tui::Tui::new()?
.tick_rate(self.tick_rate)
.frame_rate(self.frame_rate);
// tui.mouse(true);
tui.enter()?;

Expand Down Expand Up @@ -102,8 +104,8 @@ impl App {
}
}
}
},
_ => {},
}
_ => {}
}
}

Expand All @@ -114,7 +116,7 @@ impl App {
match action {
Action::Tick => {
self.last_tick_key_events.drain(..);
},
}
Action::Quit => self.should_quit = true,
Action::Suspend => self.should_suspend = true,
Action::Resume => self.should_suspend = false,
Expand All @@ -124,30 +126,34 @@ impl App {
for component in self.components.iter_mut() {
let r = component.draw(f, f.size());
if let Err(e) = r {
action_tx.send(Action::Error(format!("Failed to draw: {:?}", e))).unwrap();
action_tx
.send(Action::Error(format!("Failed to draw: {:?}", e)))
.unwrap();
}
}
})?;
},
}
Action::Render => {
tui.draw(|f| {
for component in self.components.iter_mut() {
let r = component.draw(f, f.size());
if let Err(e) = r {
action_tx.send(Action::Error(format!("Failed to draw: {:?}", e))).unwrap();
action_tx
.send(Action::Error(format!("Failed to draw: {:?}", e)))
.unwrap();
}
}
})?;
},
}
Action::SwitchScene(scene) => {
info!("Scene swtiched to: {scene:?}");
self.scene = scene;
},
}
Action::SwitchInputMode(mode) => {
info!("Input mode switched to: {mode:?}");
self.input_mode = mode;
},
_ => {},
}
_ => {}
}
for component in self.components.iter_mut() {
if let Some(action) = component.update(action.clone())? {
Expand All @@ -158,7 +164,9 @@ impl App {
if self.should_suspend {
tui.suspend()?;
action_tx.send(Action::Resume)?;
tui = tui::Tui::new()?.tick_rate(self.tick_rate).frame_rate(self.frame_rate);
tui = tui::Tui::new()?
.tick_rate(self.tick_rate)
.frame_rate(self.frame_rate);
// tui.mouse(true);
tui.enter()?;
} else if self.should_quit {
Expand Down
Loading

0 comments on commit a4efbee

Please sign in to comment.