Skip to content

Commit

Permalink
Fix: Correspondence confirm move behavior #1329 v2
Browse files Browse the repository at this point in the history
  • Loading branch information
vimarisoft committed Jan 8, 2025
1 parent 1e92fa8 commit 42f5560
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/src/view/game/game_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class GameBody extends ConsumerWidget {
materialDifferenceFormat: boardPreferences.materialDifferenceFormat,
timeToMove: gameState.game.sideToMove == Side.black ? gameState.timeToMove : null,
mePlaying: youAre == Side.black,
canGoForward: gameState.canGoForward,
zenMode: gameState.isZenModeActive,
clockPosition: boardPreferences.clockPosition,
confirmMoveCallbacks:
Expand Down Expand Up @@ -167,6 +168,7 @@ class GameBody extends ConsumerWidget {
materialDifferenceFormat: boardPreferences.materialDifferenceFormat,
timeToMove: gameState.game.sideToMove == Side.white ? gameState.timeToMove : null,
mePlaying: youAre == Side.white,
canGoForward: gameState.canGoForward,
zenMode: gameState.isZenModeActive,
clockPosition: boardPreferences.clockPosition,
confirmMoveCallbacks:
Expand Down
4 changes: 3 additions & 1 deletion lib/src/view/game/game_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class GamePlayer extends StatelessWidget {
this.timeToMove,
this.shouldLinkToUserProfile = true,
this.mePlaying = false,
this.canGoForward = false,
this.zenMode = false,
this.clockPosition = ClockPosition.right,
super.key,
Expand All @@ -52,6 +53,7 @@ class GamePlayer extends StatelessWidget {

final bool shouldLinkToUserProfile;
final bool mePlaying;
final bool canGoForward;
final bool zenMode;
final ClockPosition clockPosition;

Expand Down Expand Up @@ -164,7 +166,7 @@ class GamePlayer extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
if (clock != null && clockPosition == ClockPosition.left) Flexible(flex: 3, child: clock!),
if (mePlaying && confirmMoveCallbacks != null)
if (mePlaying && confirmMoveCallbacks != null && canGoForward == false)
Expanded(
flex: 7,
child: Padding(
Expand Down

0 comments on commit 42f5560

Please sign in to comment.