From 23fe2d690323dac0dd9d4ffec10cef989899028b Mon Sep 17 00:00:00 2001 From: Lucas Lima Date: Wed, 1 Jul 2020 23:20:13 -0300 Subject: [PATCH] Fix load user preferences --- .../common/level/viewmodel/GameViewModel.kt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/common/src/main/java/dev/lucasnlm/antimine/common/level/viewmodel/GameViewModel.kt b/common/src/main/java/dev/lucasnlm/antimine/common/level/viewmodel/GameViewModel.kt index ce850f7b..9cdbde37 100644 --- a/common/src/main/java/dev/lucasnlm/antimine/common/level/viewmodel/GameViewModel.kt +++ b/common/src/main/java/dev/lucasnlm/antimine/common/level/viewmodel/GameViewModel.kt @@ -296,14 +296,12 @@ class GameViewModel @ViewModelInject constructor( } fun refreshUserPreferences() { - if (initialized) { - val questionMark = preferencesRepository.useQuestionMark() - val controlType = preferencesRepository.controlStyle() - val gameControl = GameControl.fromControlType(controlType) - gameController.apply { - updateGameControl(gameControl) - useQuestionMark(questionMark) - } + val questionMark = preferencesRepository.useQuestionMark() + val controlType = preferencesRepository.controlStyle() + val gameControl = GameControl.fromControlType(controlType) + gameController.apply { + updateGameControl(gameControl) + useQuestionMark(questionMark) } }