fn update_stories_view(&mut self, stories: Vec<client::Story>) {
        self.view.remove_child(1);
        let starting_id = client::SEARCH_LIMIT * self.page;
        self.view.add_child(
            story_view::get_story_main_view(stories, self.client, starting_id).full_height(),
        );
        // the old Story View is deleted hence losing the current focus,
        // we need to place the focus back to the new Story View
        if self.mode == SearchViewMode::Navigation {
            self.view.set_focus_index(1).unwrap_or_else(|_| {
                // no Story View to focus on, or no stories to display,
                // change back to Search mode
                self.mode = SearchViewMode::Search;
            });
        }
    }
/// updates the Story View with new matched stories
updates the Story View with new matched stories
updates the Story View with new matched stories
fn update_stories_view(&mut self, stories: Vec<client::Story>) {
        self.view.remove_child(1);
        let starting_id = client::SEARCH_LIMIT * self.page;
        self.view.add_child(
            story_view::get_story_main_view(stories, self.client, starting_id).full_height(),
        );
        // the old Story View is deleted hence losing the current focus,
        // we need to place the focus back to the new Story View
        if self.mode == SearchViewMode::Navigation {
            self.view.set_focus_index(1).unwrap_or_else(|_| {
                // no Story View to focus on, or no stories to display,
                // change back to Search mode
                self.mode = SearchViewMode::Search;
            });
        }
    }
fn update_stories_view ( & mut self , stories : Vec < client :: Story > ) { self . view . remove_child ( 1 ) ; let starting_id = client :: SEARCH_LIMIT * self . page ; self . view . add_child ( story_view :: get_story_main_view ( stories , self . client , starting_id ) . full_height ( ) , ) ; // the old Story View is deleted hence losing the current focus, // we need to place the focus back to the new Story View if self . mode == SearchViewMode :: Navigation { self . view . set_focus_index ( 1 ) . unwrap_or_else ( | _ | { // no Story View to focus on, or no stories to display, // change back to Search mode self . mode = SearchViewMode :: Search ; } ) ; } }
updates the Story View with new matched stories
updates the Story View with new matched stories
&mut self
stories
Vec<client::Story>