Skip to content

Commit

Permalink
dont show challenges in command palette if ctf has not started yet
Browse files Browse the repository at this point in the history
  • Loading branch information
mbund committed Sep 23, 2024
1 parent c4f5f6a commit 25f415d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rhombus/src/internal/command_palette.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ pub async fn route_command_palette_items(
.map(|division| (division.id.to_string(), division.name.clone()))
.collect::<Value>();

if user.is_some() {
if let Some(user) = user {
if let Some(start_time) = state.settings.read().await.start_time {
if !user.is_admin && chrono::Utc::now() < start_time {
return Json(json!({
"divisions": divisions,
}));
}
}

let challenges = challenge_data
.categories
.iter()
Expand Down

0 comments on commit 25f415d

Please sign in to comment.