2
0
mirror of https://github.com/xvxx/phetch synced 2024-11-16 21:25:45 +00:00

drop history

This commit is contained in:
dvkt 2019-12-16 21:33:01 -08:00
parent 09d52fdbd8
commit 23c94414b5

View File

@ -90,6 +90,9 @@ impl UI {
} }
fn add_page<T: View + 'static>(&mut self, view: T) { fn add_page<T: View + 'static>(&mut self, view: T) {
if self.pages.len() > 0 && self.page < self.pages.len() - 1 {
self.pages.truncate(self.page + 1);
}
self.pages.push(Box::from(view)); self.pages.push(Box::from(view));
if self.pages.len() > 1 { if self.pages.len() > 1 {
self.page += 1; self.page += 1;