From ccca876bb07392d6ce36dda395337e12b7c22020 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Fri, 28 Jun 2024 12:34:07 -0400 Subject: [PATCH] move _instructionsShown up to be the first check in instructions show function --- lib/pangea/utils/instructions.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pangea/utils/instructions.dart b/lib/pangea/utils/instructions.dart index d3a2b0ba0a..ff0fea8f6c 100644 --- a/lib/pangea/utils/instructions.dart +++ b/lib/pangea/utils/instructions.dart @@ -41,6 +41,11 @@ class InstructionsController { String transformTargetKey, [ bool showToggle = true, ]) async { + if (_instructionsShown[key] ?? false) { + return; + } + _instructionsShown[key] = true; + if (wereInstructionsTurnedOff(key)) { return; } @@ -51,9 +56,6 @@ class InstructionsController { ); return; } - if (_instructionsShown[key] ?? false) { - return; - } final bool userLangsSet = await _pangeaController.userController.areUserLanguagesSet; @@ -61,8 +63,6 @@ class InstructionsController { return; } - _instructionsShown[key] = true; - final botStyle = BotStyle.text(context); Future.delayed( const Duration(seconds: 1),