chore: update gpui

This commit is contained in:
2026-01-14 15:00:52 +07:00
parent ac9afb1790
commit 014757cfc9
4 changed files with 87 additions and 27 deletions

View File

@@ -43,7 +43,7 @@ pub fn load_embedded_fonts(cx: &App) {
let embedded_fonts = Mutex::new(Vec::new());
let executor = cx.background_executor();
executor.block(executor.scoped(|scope| {
cx.foreground_executor().block_on(executor.scoped(|scope| {
for font_path in &font_paths {
if !font_path.ends_with(".ttf") {
continue;

View File

@@ -88,9 +88,8 @@ impl NostrRegistry {
});
// Construct the lmdb
let lmdb = cx.background_executor().block(async move {
let path = config_dir().join("nostr");
NostrLmdb::open(path)
let lmdb = cx.foreground_executor().block_on(async move {
NostrLmdb::open(config_dir().join("nostr"))
.await
.expect("Failed to initialize database")
});

View File

@@ -1,6 +1,6 @@
use std::time::Duration;
use gpui::{px, Context, Pixels, Timer};
use gpui::{px, Context, Pixels};
static INTERVAL: Duration = Duration::from_millis(500);
static PAUSE_DELAY: Duration = Duration::from_millis(300);
@@ -54,7 +54,8 @@ impl BlinkCursor {
// Schedule the next blink
let epoch = self.next_epoch();
cx.spawn(async move |this, cx| {
Timer::after(INTERVAL).await;
cx.background_executor().timer(INTERVAL).await;
if let Some(this) = this.upgrade() {
this.update(cx, |this, cx| this.blink(epoch, cx));
}
@@ -76,7 +77,7 @@ impl BlinkCursor {
// delay 500ms to start the blinking
let epoch = self.next_epoch();
cx.spawn(async move |this, cx| {
Timer::after(PAUSE_DELAY).await;
cx.background_executor().timer(PAUSE_DELAY).await;
if let Some(this) = this.upgrade() {
this.update(cx, |this, cx| {