Skip to content

Commit dff6c2b

Browse files
committed
fix: respect update notification exit
1 parent 1392b3a commit dff6c2b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/cli/commands/game.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@ pub fn run_game_session(cli: Cli) -> Result<()> {
99
log::info!("Starting GitType game session");
1010

1111
// Check for updates before starting the game session
12-
tokio::task::block_in_place(|| {
12+
let should_exit = tokio::task::block_in_place(|| {
1313
tokio::runtime::Handle::current().block_on(async {
1414
if let Ok(Some(entry)) = crate::version::VersionChecker::check_for_updates().await {
1515
if entry.update_available {
16-
let _ = crate::version::VersionChecker::display_update_notification(&entry);
16+
return crate::version::VersionChecker::display_update_notification(&entry)
17+
.map(|should_continue| !should_continue);
1718
}
1819
}
20+
Ok(false)
1921
})
20-
});
22+
})?;
23+
24+
if should_exit {
25+
log::info!("User exited after update notification");
26+
return Ok(());
27+
}
2128

2229
// Session repository will be initialized in DatabaseInitStep during loading screen
2330

0 commit comments

Comments
 (0)