From af1b303211d9180f304773076fc3b82cd9acba7e Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 17 Aug 2025 00:55:22 +0800 Subject: [PATCH] :wheelchair: Prevent user from setting empty links --- lib/screens/account/me/profile_update.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/screens/account/me/profile_update.dart b/lib/screens/account/me/profile_update.dart index 3dab2871..071912c6 100644 --- a/lib/screens/account/me/profile_update.dart +++ b/lib/screens/account/me/profile_update.dart @@ -169,11 +169,18 @@ class UpdateProfileScreen extends HookConsumerWidget { 'location': locationController.text, 'time_zone': timeZoneController.text, 'birthday': birthday.value?.toUtc().toIso8601String(), - 'links': links.value, + 'links': + links.value + .where((e) => e.name.isNotEmpty && e.url.isNotEmpty) + .toList(), }, ); final userNotifier = ref.read(userInfoProvider.notifier); userNotifier.fetchUser(); + links.value = + links.value + .where((e) => e.name.isNotEmpty && e.url.isNotEmpty) + .toList(); } catch (err) { showErrorAlert(err); } finally {