Fix a bug when trying to go to far in the history with keyboard shortcuts

This commit is contained in:
Baptiste Gelez 2019-05-11 15:15:35 +01:00 committed by Daniel Garcia Moreno
parent 5cd2c51b14
commit 2e3e1fb6f7

View file

@ -189,16 +189,12 @@ pub fn new(app: &gtk::Application, op: &Arc<Mutex<AppOp>>) {
}
}));
older_messages.connect_activate(clone!(op => move |_, _| {
let mut op = op.lock().unwrap();
if let Some(ref mut hist) = op.history {
// println!("page up");
if let Some(ref mut hist) = op.lock().unwrap().history {
hist.page_up();
}
}));
newer_messages.connect_activate(clone!(op => move |_, _| {
let mut op = op.lock().unwrap();
if let Some(ref mut hist) = op.history {
// println!("page down");
if let Some(ref mut hist) = op.lock().unwrap().history {
hist.page_down();
}
}));