Lines
92.86 %
Functions
50 %
Branches
100 %
//! The Transactions tab's server pages: a reply, a page turn and the continuation at an edge.
use crate::app::App;
use crate::tabs::fetch::Fetch;
use crate::tabs::list::ListTab;
use crate::view::Tab;
use crate::window::WindowId;
impl App {
pub(super) fn deliver_transactions_reply(&mut self, window: WindowId, wire: &str) {
let Some(list) = self.win_mut::<ListTab>(window) else {
return;
};
list.on_reply(wire);
let idle = list.state == Fetch::Idle;
if idle {
self.ensure_list_loaded(window);
}
/// Fetch the next or previous page of the Transactions tab.
pub fn page_transactions(&mut self, forward: bool) {
if let Some(window) = self.front_or_say(Tab::Transactions) {
self.load_page(window, forward, false);
/// Continue window `window` into the next (`forward`) or previous page when its selection
/// is on the loaded page's edge row; `false` when the move stays on the page.
pub fn continue_transactions_page(&mut self, window: WindowId, forward: bool) -> bool {
self.load_page(window, forward, true)
fn load_page(&mut self, window: WindowId, forward: bool, from_edge: bool) -> bool {
return false;
let turned = if from_edge {
list.turn_page_at_edge(forward)
} else {
list.turn_page(forward)
if turned {
self.load_window(window);
turned