Skip to content

Commit

Permalink
fix warp generation
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Aug 5, 2024
1 parent 62c6d07 commit 0121c12
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions lib/features/profile/add/add_profile_modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0121c12

Please sign in to comment.