renew warp configs on adding

This commit is contained in:
hiddify-com
2024-07-14 15:35:36 +02:00
parent 31054e52b6
commit 076fc14758

View File

@@ -242,7 +242,7 @@ class AddProfileModal extends HookConsumerWidget {
final _prefs = ref.read(sharedPreferencesProvider).requireValue;
final _warp = ref.read(warpOptionNotifierProvider.notifier);
final _profile = ref.read(addProfileProvider.notifier);
final consent = false && (_prefs.getBool(warpConsentGiven) ?? false);
final consent = (_prefs.getBool(warpConsentGiven) ?? false);
context.pop();
final t = ref.read(translationsProvider);
@@ -265,16 +265,16 @@ class AddProfileModal extends HookConsumerWidget {
}
}
final accountId = _prefs.getString("warp2-account-id");
final accessToken = _prefs.getString("warp2-access-token");
final hasWarp2Config = accountId != null && accessToken != null;
// final accountId = _prefs.getString("warp2-account-id");
// final accessToken = _prefs.getString("warp2-access-token");
// final hasWarp2Config = accountId != null && accessToken != null;
if (!hasWarp2Config || true) {
// if (!hasWarp2Config || true) {
final toast = notification.showInfoToast(t.profile.add.addingWarpMsg, duration: const Duration(milliseconds: 100));
toast?.pause();
await _warp.generateWarp2Config();
toast?.start();
}
// }
await _profile.add("#profile-title: Hiddify WARP\nwarp://p1@auto#National&&detour=warp://p2@auto#WoW"); //
}
}