DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

48eb5b43985b0192e19fe29d2363f904705613e5 — Jonni Liljamo 1 year, 8 months ago ccb1903
feat(client): sort games in all_forming
1 files changed, 5 insertions(+), 1 deletions(-)

M client/src/plugins/menu/ui/play/ui.rs
M client/src/plugins/menu/ui/play/ui.rs => client/src/plugins/menu/ui/play/ui.rs +5 -1
@@ 246,12 246,16 @@ fn browse_forming(
        return;
    }

    let all_forming: Vec<&GamePub> = global
    let mut all_forming: Vec<&GamePub> = global
        .games_cache
        .values()
        .filter(|g| g.state == GAMESTATE_FORMING)
        .collect();

    // sort by created_at, and reverse so it's the right way round
    all_forming.sort_by_key(|&g| &g.created_at);
    all_forming = all_forming.into_iter().rev().collect();

    if all_forming.is_empty() {
        ui.label("No forming games found.");
    } else {