From 7ba7b925ff77444738feda1431cc91a29168af14 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Wed, 13 Dec 2023 21:18:50 -0500 Subject: [PATCH] Simulate sending feedback in dev --- Cargo.lock | 1 + crates/feedback2/Cargo.toml | 7 ++++--- crates/feedback2/src/feedback_modal.rs | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba868ebbae..52fadb73e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3265,6 +3265,7 @@ dependencies = [ "serde_derive", "settings2", "smallvec", + "smol", "sysinfo", "theme2", "tree-sitter-markdown", diff --git a/crates/feedback2/Cargo.toml b/crates/feedback2/Cargo.toml index 560c5a307f..0e34ee410b 100644 --- a/crates/feedback2/Cargo.toml +++ b/crates/feedback2/Cargo.toml @@ -26,16 +26,17 @@ ui = { package = "ui2", path = "../ui2" } util = { path = "../util" } workspace = { package = "workspace2", path = "../workspace2"} -log.workspace = true -futures.workspace = true anyhow.workspace = true -smallvec.workspace = true +futures.workspace = true human_bytes = "0.4.1" isahc.workspace = true lazy_static.workspace = true +log.workspace = true postage.workspace = true serde.workspace = true serde_derive.workspace = true +smallvec.workspace = true +smol.workspace = true sysinfo.workspace = true tree-sitter-markdown = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "330ecab87a3e3a7211ac69bbadc19eabecdb1cca" } urlencoding = "2.1.2" diff --git a/crates/feedback2/src/feedback_modal.rs b/crates/feedback2/src/feedback_modal.rs index e5c1ccdc9d..d1c6572f3e 100644 --- a/crates/feedback2/src/feedback_modal.rs +++ b/crates/feedback2/src/feedback_modal.rs @@ -22,6 +22,7 @@ use crate::{system_specs::SystemSpecs, GiveFeedback, OpenZedCommunityRepo}; // For UI testing purposes const SEND_SUCCESS_IN_DEV_MODE: bool = true; +const SEND_TIME_IN_DEV_MODE: Duration = Duration::from_secs(2); // Temporary, until tests are in place #[cfg(debug_assertions)] @@ -273,6 +274,8 @@ impl FeedbackModal { system_specs: SystemSpecs, ) -> anyhow::Result<()> { if DEV_MODE { + smol::Timer::after(SEND_TIME_IN_DEV_MODE).await; + if SEND_SUCCESS_IN_DEV_MODE { return Ok(()); } else {