Skip to content

Commit

Permalink
Less progress notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
dantleech committed Nov 12, 2024
1 parent acb4289 commit b05eb60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/component/log_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl View for LogView {
}
fn handle(&mut self, app: &mut crate::app::App, key: crate::event::keymap::MappedKey) {
match key.strava_event {
StravaEvent::Quit => app.quit = true,
StravaEvent::Quit => app.switch_to_previous(),
StravaEvent::ToggleLogView => app.switch_to_previous(),
StravaEvent::Down => app.log_view_state.transition(tui_logger::TuiWidgetEvent::NextPageKey),
StravaEvent::Up => app.log_view_state.transition(tui_logger::TuiWidgetEvent::PrevPageKey),
Expand Down
5 changes: 4 additions & 1 deletion src/sync/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ impl ActivityConverter<'_> {
"#
).fetch_all(self.pool).await?;

self.logger.info(format!("Converting activities")).await;
let mut i = 0;
for raw_activity in raw_activities {
let listed: client::Activity =
serde_json::from_str(match &raw_activity.activity {
Some(a) => &a.as_str(),
None => raw_activity.listed.as_str()
}).expect("Could not decode JSON");
self.logger.info(format!("Converting activity {}", listed.name)).await;
if i % 10 == 0 { self.logger.info(format!("Converting activity {}", listed.name)).await;}
i = i + 1;
let activity = Activity {
id: listed.id,
title: listed.name.clone(),
Expand Down

0 comments on commit b05eb60

Please sign in to comment.