mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-02-05 16:04:15 +00:00
update all tabs on id not found
This commit is contained in:
parent
6c4137f2b6
commit
eb6d77328d
@ -209,15 +209,31 @@ impl Tab {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&self, id: &str) {
|
pub fn update(&self, id: &str) {
|
||||||
if let Some(item) = self.index.borrow().get(id) {
|
match self.index.borrow().get(id) {
|
||||||
// Update item components
|
Some(item) => {
|
||||||
item.update();
|
// Update item components
|
||||||
|
item.update();
|
||||||
|
|
||||||
// Update tab title on loading indicator inactive
|
// Update tab title on loading indicator inactive
|
||||||
if !item.page_is_loading() {
|
if !item.page_is_loading() {
|
||||||
if let Some(title) = item.page_meta_title() {
|
if let Some(title) = item.page_meta_title() {
|
||||||
item.gobject().set_title(title.as_str())
|
item.gobject().set_title(title.as_str())
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Update all tabs on ID not found @TODO change initial update method
|
||||||
|
None => {
|
||||||
|
for (_, item) in self.index.borrow().iter() {
|
||||||
|
// Update item components
|
||||||
|
item.update();
|
||||||
|
|
||||||
|
// Update tab title on loading indicator inactive
|
||||||
|
if !item.page_is_loading() {
|
||||||
|
if let Some(title) = item.page_meta_title() {
|
||||||
|
item.gobject().set_title(title.as_str())
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user