mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55: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 window_action = window_action.clone();
|
||||
move |tab_view, tab_page| {
|
||||
// cleanup HashMap index
|
||||
// add history record into profile memory pool
|
||||
// * this action allows to recover recently closed tab (e.g. from the main menu)
|
||||
profile.history.memory.tab.add(
|
||||
index.borrow_mut().remove(tab_page).unwrap(),
|
||||
DateTime::now_local().unwrap().to_unix(),
|
||||
);
|
||||
// remove closed Item from Tab index
|
||||
if let Some(item) = index.borrow_mut().remove(tab_page) {
|
||||
// keep removed `Item` reference in the memory (to reopen from the main menu)
|
||||
// * skip item with blank request
|
||||
if !item.page.navigation.request().is_empty() {
|
||||
profile
|
||||
.history
|
||||
.memory
|
||||
.tab
|
||||
.add(item, DateTime::now_local().unwrap().to_unix());
|
||||
}
|
||||
}
|
||||
// reassign global actions to active tab
|
||||
update_actions(
|
||||
tab_view,
|
||||
tab_view.selected_page().as_ref(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue