agent: Make token indicator not flash if last count tokens request failed (#29628)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-04-29 17:03:18 -06:00 committed by GitHub
parent d7004030b3
commit 1a4d7249f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1138,14 +1138,14 @@ impl MessageEditor {
Some(0)
};
if let Some(token_count) = token_count {
this.update(cx, |this, cx| {
this.update(cx, |this, cx| {
if let Some(token_count) = token_count {
this.last_estimated_token_count = Some(token_count);
cx.emit(MessageEditorEvent::EstimatedTokenCount);
this.update_token_count_task.take();
})
.ok();
}
}
this.update_token_count_task.take();
})
.ok();
}));
}
}