Revert "Differentiate between first time app starts and subsequent ones"

This commit is contained in:
Joseph T Lyons 2022-11-02 12:22:46 -04:00
parent aafc3a9584
commit d8685baa47
2 changed files with 8 additions and 17 deletions

View File

@ -157,16 +157,13 @@ impl Telemetry {
self.executor
.spawn(
async move {
let (device_id, is_first_time_start) =
if let Ok(Some(device_id)) = db.read_kvp("device_id") {
(device_id, false)
} else {
let device_id = Uuid::new_v4().to_string();
db.write_kvp("device_id", &device_id)?;
(device_id, true)
};
this.report_start_app(is_first_time_start);
let device_id = if let Ok(Some(device_id)) = db.read_kvp("device_id") {
device_id
} else {
let device_id = Uuid::new_v4().to_string();
db.write_kvp("device_id", &device_id)?;
device_id
};
let device_id: Arc<str> = device_id.into();
let mut state = this.state.lock();
@ -263,13 +260,6 @@ impl Telemetry {
}
}
pub fn report_start_app(self: &Arc<Self>, is_first_time_start: bool) {
self.report_event(
"start app",
json!({ "First Time Open": is_first_time_start }),
)
}
fn flush(self: &Arc<Self>) {
let mut state = self.state.lock();
let mut events = mem::take(&mut state.queue);

View File

@ -150,6 +150,7 @@ fn main() {
let project_store = cx.add_model(|_| ProjectStore::new());
let db = cx.background().block(db);
client.start_telemetry(db.clone());
client.report_event("start app", Default::default());
let app_state = Arc::new(AppState {
languages,