mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
skip history record for items with blank request
This commit is contained in:
parent
ff326290c6
commit
4215fb130d
1 changed files with 13 additions and 7 deletions
|
|
@ -82,13 +82,19 @@ impl Tab {
|
||||||
let profile = profile.clone();
|
let profile = profile.clone();
|
||||||
let window_action = window_action.clone();
|
let window_action = window_action.clone();
|
||||||
move |tab_view, tab_page| {
|
move |tab_view, tab_page| {
|
||||||
// cleanup HashMap index
|
// remove closed Item from Tab index
|
||||||
// add history record into profile memory pool
|
if let Some(item) = index.borrow_mut().remove(tab_page) {
|
||||||
// * this action allows to recover recently closed tab (e.g. from the main menu)
|
// keep removed `Item` reference in the memory (to reopen from the main menu)
|
||||||
profile.history.memory.tab.add(
|
// * skip item with blank request
|
||||||
index.borrow_mut().remove(tab_page).unwrap(),
|
if !item.page.navigation.request().is_empty() {
|
||||||
DateTime::now_local().unwrap().to_unix(),
|
profile
|
||||||
);
|
.history
|
||||||
|
.memory
|
||||||
|
.tab
|
||||||
|
.add(item, DateTime::now_local().unwrap().to_unix());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// reassign global actions to active tab
|
||||||
update_actions(
|
update_actions(
|
||||||
tab_view,
|
tab_view,
|
||||||
tab_view.selected_page().as_ref(),
|
tab_view.selected_page().as_ref(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue