Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #77 from KMastroluca/main
Browse files Browse the repository at this point in the history
Fixed Issue Where Options  And Response Body Would Persist In An Unreasonable Way
  • Loading branch information
PThorpe92 authored Oct 30, 2023
2 parents 71ae4a2 + ab6512d commit 25fe293
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,19 @@ impl<'a> App<'a> {
}

pub fn goto_screen(&mut self, screen: Screen) {

// Push New/Next Screen Onto The Screen Stack
self.screen_stack.push(screen.clone());

// Set The Current Screen
self.current_screen = screen.clone();

self.cursor = 0;
match screen {
Screen::Method => {
// If The Method Screen Is Hit, We Reset options
self.remove_all_app_options();
}
Screen::SavedKeys => {
self.items = self
.get_saved_keys()
Expand Down
3 changes: 3 additions & 0 deletions src/screens/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ use tui::Frame;

pub fn handle_home_screen<B: Backend>(app: &mut App, frame: &mut Frame<'_, B>) {
handle_screen_defaults(app, frame);



if let Some(num) = app.selected {
match num {
0 => {
Expand Down
1 change: 1 addition & 0 deletions src/screens/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pub fn handle_response_screen<B: Backend>(app: &mut App, frame: &mut Frame<'_, B
}
}
4 => {
// Return To Home
app.remove_all_app_options();
app.goto_screen(Screen::Home);
}
Expand Down

0 comments on commit 25fe293

Please sign in to comment.