Simulate sending feedback in dev

This commit is contained in:
Joseph T. Lyons 2023-12-13 21:18:50 -05:00
parent ceede28fab
commit 7ba7b925ff
3 changed files with 8 additions and 3 deletions

1
Cargo.lock generated
View File

@ -3265,6 +3265,7 @@ dependencies = [
"serde_derive",
"settings2",
"smallvec",
"smol",
"sysinfo",
"theme2",
"tree-sitter-markdown",

View File

@ -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"

View File

@ -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 {