This commit is contained in:
2026-08-03 08:52:37 +07:00
parent a1e1133bdc
commit c3b5bbc1b2
5 changed files with 82 additions and 8 deletions

View File

@@ -14,6 +14,7 @@ chat = { path = "../chat" }
chat_ui = { path = "../chat_ui" }
settings = { path = "../settings" }
person = { path = "../person" }
auto_update = { path = "../auto_update" }
gpui.workspace = true
nostr-sdk.workspace = true

View File

@@ -2,6 +2,7 @@ use std::sync::Arc;
use ::settings::AppSettings;
use anyhow::Error;
use auto_update::AutoUpdater;
use chat::{ChatEvent, ChatRegistry};
use common::{CoopImageCache, download_dir};
use device::{DeviceEvent, DeviceRegistry};
@@ -379,7 +380,12 @@ impl Workspace {
self.import_encryption(window, cx);
}
Command::Update => {
//
let auto_updater = AutoUpdater::global(cx);
auto_updater.update(cx, |this, cx| {
this.updater.update(cx, |updater, cx| {
updater.check(cx);
});
});
}
}
}
@@ -604,6 +610,7 @@ impl Workspace {
}
fn titlebar_right(&mut self, cx: &mut Context<Self>) -> impl IntoElement {
let updater = AutoUpdater::global(cx);
let chat = ChatRegistry::global(cx);
let nip4e_enabled = AppSettings::get_nip4e(cx);
let nostr = NostrRegistry::global(cx);
@@ -615,10 +622,15 @@ impl Workspace {
let persons = PersonRegistry::global(cx);
let profile = persons.read(cx).get(&public_key, cx);
let announcement = profile.announcement();
let updater_idle = updater.read(cx).idle(cx);
h_flex()
.when(!cx.theme().platform.is_mac(), |this| this.pr_2())
.gap_2()
.when(!updater_idle, |this| {
let status = updater.read(cx).status(cx);
this.child(div().text_xs().italic().child(status))
})
.when(nip4e_enabled, |this| {
this.child(
Button::new("key")