mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-09 00:50:04 +03:00
Add feedback for telemetry item when there's no data
This commit is contained in:
parent
74b10e4ba5
commit
9398de6a57
@ -577,8 +577,13 @@ fn open_telemetry_log_file(
|
||||
workspace.with_local_workspace(&app_state.clone(), cx, move |_, cx| {
|
||||
cx.spawn_weak(|workspace, mut cx| async move {
|
||||
let workspace = workspace.upgrade(&cx)?;
|
||||
let path = app_state.client.telemetry_log_file_path()?;
|
||||
let log = app_state.fs.load(&path).await.log_err()?;
|
||||
|
||||
async fn fetch_log_string(app_state: &Arc<AppState>) -> Option<String> {
|
||||
let path = app_state.client.telemetry_log_file_path()?;
|
||||
app_state.fs.load(&path).await.log_err()
|
||||
}
|
||||
|
||||
let log = fetch_log_string(&app_state).await.unwrap_or_else(|| "// No data has been collected yet".to_string());
|
||||
|
||||
const MAX_TELEMETRY_LOG_LEN: usize = 5 * 1024 * 1024;
|
||||
let mut start_offset = log.len().saturating_sub(MAX_TELEMETRY_LOG_LEN);
|
||||
|
Loading…
Reference in New Issue
Block a user