mirror of
https://github.com/openai/codex.git
synced 2026-04-27 09:51:03 +03:00
Drop legacy way
This commit is contained in:
@@ -40,9 +40,6 @@ use std::time::Duration;
|
||||
use tokio::select;
|
||||
use tokio::sync::mpsc::unbounded_channel;
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
use crate::history_cell::UpdateAvailableHistoryCell;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct AppExitInfo {
|
||||
pub token_usage: TokenUsage,
|
||||
@@ -149,9 +146,6 @@ impl App {
|
||||
};
|
||||
|
||||
let file_search = FileSearchManager::new(config.cwd.clone(), app_event_tx.clone());
|
||||
#[cfg(not(debug_assertions))]
|
||||
let upgrade_version = crate::updates::get_upgrade_version(&config);
|
||||
|
||||
let mut app = Self {
|
||||
server: conversation_manager,
|
||||
app_event_tx,
|
||||
@@ -175,20 +169,6 @@ impl App {
|
||||
app.handle_event(tui, event).await?;
|
||||
}
|
||||
|
||||
// TODO(jif) clean this
|
||||
#[cfg(not(debug_assertions))]
|
||||
if let Some(latest_version) = upgrade_version {
|
||||
app.handle_event(
|
||||
tui,
|
||||
AppEvent::InsertHistoryCell(Box::new(UpdateAvailableHistoryCell::new(
|
||||
crate::version::CODEX_CLI_VERSION,
|
||||
latest_version,
|
||||
crate::updates::get_update_action(),
|
||||
))),
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
|
||||
let tui_events = tui.event_stream();
|
||||
tokio::pin!(tui_events);
|
||||
|
||||
|
||||
@@ -316,25 +316,12 @@ async fn run_ratatui_app(
|
||||
|
||||
let mut initial_events = Vec::new();
|
||||
if let Some(status) = cached_update_status
|
||||
&& status.update_available {
|
||||
let update_action = {
|
||||
#[cfg(not(debug_assertions))]
|
||||
{
|
||||
crate::updates::get_update_action()
|
||||
}
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
None
|
||||
}
|
||||
};
|
||||
initial_events.push(AppEvent::InsertHistoryCell(Box::new(
|
||||
UpdateAvailableHistoryCell::new(
|
||||
status.current_version,
|
||||
status.latest_version,
|
||||
update_action,
|
||||
),
|
||||
)));
|
||||
}
|
||||
&& status.update_available
|
||||
{
|
||||
initial_events.push(AppEvent::InsertHistoryCell(Box::new(
|
||||
UpdateAvailableHistoryCell::new(status.current_version, status.latest_version, None),
|
||||
)));
|
||||
}
|
||||
|
||||
// Forward panic reports through tracing so they appear in the UI status
|
||||
// line, but do not swallow the default/color-eyre panic handler.
|
||||
|
||||
Reference in New Issue
Block a user