Skip to content

Commit

Permalink
Merge pull request #157 from card-io-ecg/message
Browse files Browse the repository at this point in the history
Don't show message if measurement is discarded anyway
  • Loading branch information
bugadani committed Dec 6, 2023
2 parents 6cf811a + 52e494b commit f7d78f1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/states/upload_or_store_measurement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ pub async fn upload_or_store_measurement<const SIZE: usize>(
debug!("Measurement length: {} samples", sample_count);

if sample_count < 20 * SAMPLE_RATE {
// We don't want to store too-short measurements.
debug!("Measurement is too short to upload or store.");
context
.display_message("Measurement too short, discarding")
.await;
if context.config.measurement_action != MeasurementAction::Discard {
// We don't want to store too-short measurements.
debug!("Measurement is too short to upload or store.");
context
.display_message("Measurement too short, discarding")
.await;
}
return next_state;
}

Expand Down

0 comments on commit f7d78f1

Please sign in to comment.