fix(ui-gpui): re-enable start_blinking (was disabled for testing)
This commit is contained in:
parent
3859317477
commit
640e2bd494
2 changed files with 2 additions and 11 deletions
|
|
@ -19,21 +19,15 @@ impl BlinkState {
|
|||
|
||||
pub fn start_from_context<V: 'static>(entity: &Entity<Self>, cx: &mut Context<V>) {
|
||||
let weak = entity.downgrade();
|
||||
eprintln!("[BlinkState] Starting blink timer");
|
||||
cx.spawn(async move |_parent: WeakEntity<V>, cx: &mut AsyncApp| {
|
||||
eprintln!("[BlinkState] Spawn executing — entering blink loop");
|
||||
loop {
|
||||
cx.background_executor().timer(Duration::from_millis(500)).await;
|
||||
let ok = weak.update(cx, |state, cx| {
|
||||
state.visible = !state.visible;
|
||||
state.epoch += 1;
|
||||
eprintln!("[BlinkState] Toggled visible={}", state.visible);
|
||||
cx.notify();
|
||||
});
|
||||
if ok.is_err() {
|
||||
eprintln!("[BlinkState] Entity dropped, stopping blink");
|
||||
break;
|
||||
}
|
||||
if ok.is_err() { break; }
|
||||
}
|
||||
}).detach();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue