fix(content): wait for final installed icons across manifest binding
This commit is contained in:
1 parent
d38b0b74b5
commit
a78bcff171
2 files changed
+41
-17
No files matched your search
@@ -364,10 +364,6 @@ impl Default for ContentListState {
|
||||
}
|
||||
}
|
||||
|
||||
fn needs_icon_before_showing(entry: &ContentEntry) -> bool {
|
||||
entry.icon_lines.is_none() && (entry.icon_bytes.is_some() || entry.provider_icon)
|
||||
}
|
||||
|
||||
impl ContentListState {
|
||||
pub(crate) fn has_pending_icons(&self) -> bool {
|
||||
!self.pending_entry_images.is_empty()
|
||||
@@ -813,7 +809,8 @@ impl ContentListState {
|
||||
if let Some(entry) = self.entries.iter_mut().find(|entry| {
|
||||
entry.file_stem == result.file_stem
|
||||
&& entry.path == result.path
|
||||
&& entry.provider_project == result.source
|
||||
&& (matches!(self.stream_order, ContentStreamOrder::Sorted)
|
||||
|| entry.provider_project == result.source)
|
||||
&& entry.icon_bytes.as_ref() == Some(&result.icon_bytes)
|
||||
}) {
|
||||
self.pending_entry_images.remove(&result.file_stem);
|
||||
@@ -852,7 +849,7 @@ impl ContentListState {
|
||||
self.sort_metadata.get_mut().remove(&entry.path);
|
||||
self.images_dirty = true;
|
||||
received_count += 1;
|
||||
if needs_icon_before_showing(&entry) {
|
||||
if entry.icon_bytes.is_some() || entry.provider_icon {
|
||||
self.pending_entry_images.insert(entry.file_stem.clone());
|
||||
}
|
||||
self.display_metadata
|
||||
@@ -1176,7 +1173,7 @@ impl ContentListState {
|
||||
self.images_dirty = true;
|
||||
continue;
|
||||
}
|
||||
if needs_icon_before_showing(&entry) {
|
||||
if entry.icon_bytes.is_some() || entry.provider_icon {
|
||||
self.pending_entry_images.insert(entry.file_stem.clone());
|
||||
}
|
||||
self.display_metadata
|
||||
@@ -1700,7 +1697,7 @@ impl ContentListState {
|
||||
self.pending_entry_images.extend(
|
||||
self.entries
|
||||
.iter()
|
||||
.filter(|entry| needs_icon_before_showing(entry))
|
||||
.filter(|entry| entry.icon_bytes.is_some() || entry.provider_icon)
|
||||
.map(|entry| entry.file_stem.clone()),
|
||||
);
|
||||
self.rebuild_display_metadata();
|
||||
|
||||
Reference in new issue
Block a user