Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions crates/openlogi-gui/src/app_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,13 @@ fn device_menu_items(cx: &App) -> Vec<MenuItem> {
Some(battery) => format!("{} · {}%", record.display_name, battery.percentage),
None => record.display_name.clone(),
};
items.push(MenuItem::action(title, OpenSettings).disabled(true));
items.push(MenuItem::action(title, gpui::NoAction).disabled(true));
}
}
_ => items.push(MenuItem::action(tr!("No devices connected"), OpenSettings).disabled(true)),
_ => {
items
.push(MenuItem::action(tr!("No devices connected"), gpui::NoAction).disabled(true));
}
}

items
Expand Down
8 changes: 6 additions & 2 deletions crates/openlogi-gui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ fn main() -> Result<()> {
// Scanning window overlaps the first sync's completion).
let force_refresh = inventory_ready && std::mem::take(&mut assets_dirty);
let (auto_download, asset_source, models) = cx.update(|cx| {
let (changed, auto_download, asset_source, models) = cx.update_global::<AppState, _>(|state, _| {
let (changed, merged, auto_download, asset_source, models) = cx.update_global::<AppState, _>(|state, _| {
// Merge only *completed* enumerations. A not-yet-ready
// agent can only serve an empty pre-enumeration list, and
// counting those as misses would wipe the device list (and
Expand All @@ -334,16 +334,20 @@ fn main() -> Result<()> {
let settings = state.app_settings();
(
changed,
merged,
settings.auto_download_assets,
settings.asset_source,
state.asset_models(),
)
});
// The steady poll mostly repeats an identical snapshot;
// skip the full-window invalidation for those.
// skip the full-window invalidation and menu rebuild for those.
if changed {
cx.refresh_windows();
}
if merged {
app_menu::rebuild(cx);
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
(auto_download, asset_source, models)
});
// Kick off (or re-arm) the background asset sync. The
Expand Down