From 482962abdf1682fb4c9acbfd4d6e6b98cc51911b Mon Sep 17 00:00:00 2001 From: hiddify-com <114227601+hiddify-com@users.noreply.github.com> Date: Tue, 30 Jul 2024 15:54:44 +0200 Subject: [PATCH] fix: editor text mode bug --- lib/features/profile/details/json_editor.dart | 3 +-- .../profile/details/profile_details_notifier.dart | 9 ++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/features/profile/details/json_editor.dart b/lib/features/profile/details/json_editor.dart index 461d116e..c53c0ed0 100644 --- a/lib/features/profile/details/json_editor.dart +++ b/lib/features/profile/details/json_editor.dart @@ -555,8 +555,7 @@ class _JsonEditorState extends State { controller: _controller, onChanged: parseData, maxLines: 10, - minLines: null, - expands: true, + // expands: true, textAlignVertical: TextAlignVertical.top, decoration: const InputDecoration( border: InputBorder.none, diff --git a/lib/features/profile/details/profile_details_notifier.dart b/lib/features/profile/details/profile_details_notifier.dart index eb3a10dd..6c86c47b 100644 --- a/lib/features/profile/details/profile_details_notifier.dart +++ b/lib/features/profile/details/profile_details_notifier.dart @@ -157,7 +157,14 @@ class ProfileDetailsNotifier extends _$ProfileDetailsNotifier with AppLogger { case LocalProfileEntity() when value.isEditing: loggy.debug('editing profile'); failureOrSuccess = await _profilesRepo.patch(profile).run(); - + if (failureOrSuccess.isRight()) { + failureOrSuccess = await _profilesRepo + .updateContent( + profile.id, + value.configContent, + ) + .run(); + } default: loggy.warning("local profile can't be added manually"); }