From 97d2427b44cdd8a4c05523d3772bd2e62cd06d9b Mon Sep 17 00:00:00 2001 From: hiddify-com <114227601+hiddify-com@users.noreply.github.com> Date: Fri, 5 Jul 2024 00:26:08 +0200 Subject: [PATCH] fix intro page buug --- lib/features/intro/widget/intro_page.dart | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/lib/features/intro/widget/intro_page.dart b/lib/features/intro/widget/intro_page.dart index f838100d..5f222e0f 100644 --- a/lib/features/intro/widget/intro_page.dart +++ b/lib/features/intro/widget/intro_page.dart @@ -20,23 +20,19 @@ import 'package:timezone_to_country/timezone_to_country.dart'; class IntroPage extends HookConsumerWidget with PresLogger { IntroPage({super.key}); - final locationInfoLoaded = useState(false); + bool locationInfoLoaded = false; @override Widget build(BuildContext context, WidgetRef ref) { final t = ref.watch(translationsProvider); final isStarting = useState(false); - useEffect( - () { - if (!locationInfoLoaded.value) { - autoSelectRegion(ref).then((value) => loggy.debug("Auto Region selection finished!")); - locationInfoLoaded.value = true; - } - return null; - }, - [], - ); + + if (!locationInfoLoaded) { + autoSelectRegion(ref).then((value) => loggy.debug("Auto Region selection finished!")); + locationInfoLoaded = true; + } + return Scaffold( body: SafeArea( child: CustomScrollView(