From 3c8420a3d59a5f656e8aa31da414628b6e93ce29 Mon Sep 17 00:00:00 2001 From: hiddify-com <114227601+hiddify-com@users.noreply.github.com> Date: Fri, 26 Jul 2024 13:34:49 +0200 Subject: [PATCH] fix: add warp issue --- lib/features/profile/add/add_profile_modal.dart | 3 ++- lib/features/profile/data/profile_repository.dart | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/features/profile/add/add_profile_modal.dart b/lib/features/profile/add/add_profile_modal.dart index ae42ffee..24a614e6 100644 --- a/lib/features/profile/add/add_profile_modal.dart +++ b/lib/features/profile/add/add_profile_modal.dart @@ -244,6 +244,7 @@ class AddProfileModal extends HookConsumerWidget { final _warp = ref.read(warpOptionNotifierProvider.notifier); final _profile = ref.read(addProfileProvider.notifier); final consent = (_prefs.getBool(warpConsentGiven) ?? false); + final region = ref.read(ConfigOptions.region.notifier).raw(); context.pop(); final t = ref.read(translationsProvider); @@ -276,7 +277,7 @@ class AddProfileModal extends HookConsumerWidget { await _warp.generateWarp2Config(); 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"); // } else { await _profile.add("https://raw.githubusercontent.com/hiddify/hiddify-next/main/test.configs/warp"); // diff --git a/lib/features/profile/data/profile_repository.dart b/lib/features/profile/data/profile_repository.dart index a50518ab..36b4ad54 100644 --- a/lib/features/profile/data/profile_repository.dart +++ b/lib/features/profile/data/profile_repository.dart @@ -274,7 +274,7 @@ class ProfileRepositoryImpl with ExceptionHandler, InfraLogger implements Profil .flatMap( (remoteProfile) => TaskEither( () 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( baseProfile.id,