From e796a8c552b453a0944d9b12041474489f2297b0 Mon Sep 17 00:00:00 2001 From: Denis Repin Date: Tue, 29 Oct 2024 23:27:03 +0300 Subject: [PATCH] fix(AdvancedHint): use hint only when timer is running --- .../main/java/com/kaajjo/libresudoku/ui/game/GameScreen.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/kaajjo/libresudoku/ui/game/GameScreen.kt b/app/src/main/java/com/kaajjo/libresudoku/ui/game/GameScreen.kt index 9ba7747..fc9d260 100644 --- a/app/src/main/java/com/kaajjo/libresudoku/ui/game/GameScreen.kt +++ b/app/src/main/java/com/kaajjo/libresudoku/ui/game/GameScreen.kt @@ -454,7 +454,11 @@ fun GameScreen( ToolbarItem( modifier = Modifier.weight(1f), painter = rememberVectorPainter(Icons.Rounded.AutoAwesome), - onClick = { viewModel.getAdvancedHint() } + onClick = { + if (viewModel.gamePlaying) { + viewModel.getAdvancedHint() + } + } ) } }