fix: add warp issue

This commit is contained in:
hiddify-com
2024-07-26 13:34:49 +02:00
parent 02e516a2d8
commit 3c8420a3d5
2 changed files with 3 additions and 2 deletions

View File

@@ -244,6 +244,7 @@ class AddProfileModal extends HookConsumerWidget {
final _warp = ref.read(warpOptionNotifierProvider.notifier); final _warp = ref.read(warpOptionNotifierProvider.notifier);
final _profile = ref.read(addProfileProvider.notifier); final _profile = ref.read(addProfileProvider.notifier);
final consent = (_prefs.getBool(warpConsentGiven) ?? false); final consent = (_prefs.getBool(warpConsentGiven) ?? false);
final region = ref.read(ConfigOptions.region.notifier).raw();
context.pop(); context.pop();
final t = ref.read(translationsProvider); final t = ref.read(translationsProvider);
@@ -276,7 +277,7 @@ class AddProfileModal extends HookConsumerWidget {
await _warp.generateWarp2Config(); await _warp.generateWarp2Config();
toast?.start(); toast?.start();
// } // }
if (ref.read(ConfigOptions.region.notifier).raw() == "cn") { if (region == "cn") {
await _profile.add("#profile-title: Hiddify WARP\nwarp://p1@auto#National&&detour=warp://p2@auto#WoW"); // await _profile.add("#profile-title: Hiddify WARP\nwarp://p1@auto#National&&detour=warp://p2@auto#WoW"); //
} else { } else {
await _profile.add("https://raw.githubusercontent.com/hiddify/hiddify-next/main/test.configs/warp"); // await _profile.add("https://raw.githubusercontent.com/hiddify/hiddify-next/main/test.configs/warp"); //

View File

@@ -274,7 +274,7 @@ class ProfileRepositoryImpl with ExceptionHandler, InfraLogger implements Profil
.flatMap( .flatMap(
(remoteProfile) => TaskEither( (remoteProfile) => TaskEither(
() async { () async {
final profilePatch = remoteProfile.subInfoPatch().copyWith(lastUpdate: Value(DateTime.now())); final profilePatch = remoteProfile.subInfoPatch().copyWith(lastUpdate: Value(DateTime.now()), active: Value(baseProfile.active));
await profileDataSource.edit( await profileDataSource.edit(
baseProfile.id, baseProfile.id,