Skip to content

Commit

Permalink
final move saves board
Browse files Browse the repository at this point in the history
  • Loading branch information
randallard committed Nov 30, 2024
1 parent 781b84b commit ea119b1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/components/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub fn BoardCreator(
view! { <span>"Start"</span> }.into_any()
} else if let Some((p_row, p_col)) = find_player(&board.get()) {
match board.get().grid[row][col] {
CellContent::Empty if is_adjacent(p_row, p_col, row, col) =>
CellContent::Empty if is_adjacent(p_row, p_col, row, col) && row <= p_row =>
view! {
<div class="flex flex-col gap-1">
<button class="px-2 py-1 bg-blue-600 rounded text-sm"
Expand All @@ -134,7 +134,7 @@ pub fn BoardCreator(
CellContent::Trap => view! { <span>"×"</span> }.into_any(),
}
} else {
view! { <span>"·"</span> }.into_any()
view! { <span>" "</span> }.into_any()
}
}}
</button>
Expand All @@ -161,11 +161,6 @@ pub fn BoardCreator(
>
"Cancel"
</button>
{move || finished.get().then(|| view! {
<button class="px-4 py-2 bg-blue-600 rounded hover:bg-blue-700">
"Save Board"
</button>
})}
</div>
</div>
}
Expand Down

0 comments on commit ea119b1

Please sign in to comment.