From 0121c127eee84b0603918f8132038c28ac695957 Mon Sep 17 00:00:00 2001 From: hiddify-com <114227601+hiddify-com@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:25:21 +0200 Subject: [PATCH] fix warp generation --- lib/features/profile/add/add_profile_modal.dart | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/features/profile/add/add_profile_modal.dart b/lib/features/profile/add/add_profile_modal.dart index 0e28f096..b622e591 100644 --- a/lib/features/profile/add/add_profile_modal.dart +++ b/lib/features/profile/add/add_profile_modal.dart @@ -256,23 +256,20 @@ class AddProfileModal extends HookConsumerWidget { builder: (context) => const WarpLicenseAgreementModal(), ); - if (agreed ?? false) { - await _prefs.setBool(warpConsentGiven, true); - final toast = notification.showInfoToast(t.profile.add.addingWarpMsg, duration: const Duration(milliseconds: 100)); - toast?.pause(); - await _warp.generateWarpConfig(); - toast?.start(); - } else { - return; - } + if (agreed != true) return; } + await _prefs.setBool(warpConsentGiven, true); + var toast = notification.showInfoToast(t.profile.add.addingWarpMsg, duration: const Duration(milliseconds: 100)); + toast?.pause(); + await _warp.generateWarpConfig(); + toast?.start(); // final accountId = _prefs.getString("warp2-account-id"); // final accessToken = _prefs.getString("warp2-access-token"); // final hasWarp2Config = accountId != null && accessToken != null; // if (!hasWarp2Config || true) { - final toast = notification.showInfoToast(t.profile.add.addingWarpMsg, duration: const Duration(milliseconds: 100)); + toast = notification.showInfoToast(t.profile.add.addingWarpMsg, duration: const Duration(milliseconds: 100)); toast?.pause(); await _warp.generateWarp2Config(); toast?.start();