Disable app close event

This commit is contained in:
Joseph T. Lyons 2023-11-22 23:01:31 -05:00
parent a876b6f700
commit 575ab81409

View file

@ -155,19 +155,19 @@ impl Telemetry {
// We should only ever have one instance of Telemetry, leak the subscription to keep it alive // We should only ever have one instance of Telemetry, leak the subscription to keep it alive
// rather than store in TelemetryState, complicating spawn as subscriptions are not Send // rather than store in TelemetryState, complicating spawn as subscriptions are not Send
std::mem::forget(cx.on_app_quit({ // std::mem::forget(cx.on_app_quit({
let this = this.clone(); // let this = this.clone();
move |cx| this.shutdown_telemetry(cx) // move |cx| this.shutdown_telemetry(cx)
})); // }));
this this
} }
fn shutdown_telemetry(self: &Arc<Self>, cx: &mut AppContext) -> impl Future<Output = ()> { // fn shutdown_telemetry(self: &Arc<Self>, cx: &mut AppContext) -> impl Future<Output = ()> {
let telemetry_settings = TelemetrySettings::get_global(cx).clone(); // let telemetry_settings = TelemetrySettings::get_global(cx).clone();
self.report_app_event(telemetry_settings, "close"); // self.report_app_event(telemetry_settings, "close");
Task::ready(()) // Task::ready(())
} // }
pub fn log_file_path(&self) -> Option<PathBuf> { pub fn log_file_path(&self) -> Option<PathBuf> {
Some(self.state.lock().log_file.as_ref()?.path().to_path_buf()) Some(self.state.lock().log_file.as_ref()?.path().to_path_buf())