♿ Prevent user from setting empty links
This commit is contained in:
@@ -169,11 +169,18 @@ class UpdateProfileScreen extends HookConsumerWidget {
|
|||||||
'location': locationController.text,
|
'location': locationController.text,
|
||||||
'time_zone': timeZoneController.text,
|
'time_zone': timeZoneController.text,
|
||||||
'birthday': birthday.value?.toUtc().toIso8601String(),
|
'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);
|
final userNotifier = ref.read(userInfoProvider.notifier);
|
||||||
userNotifier.fetchUser();
|
userNotifier.fetchUser();
|
||||||
|
links.value =
|
||||||
|
links.value
|
||||||
|
.where((e) => e.name.isNotEmpty && e.url.isNotEmpty)
|
||||||
|
.toList();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
showErrorAlert(err);
|
showErrorAlert(err);
|
||||||
} finally {
|
} finally {
|
||||||
|
Reference in New Issue
Block a user