fix(sos-contacts): prevent deleting last emergency contact

This commit is contained in:
2026-04-21 17:59:29 +02:00
parent b8f5c5d6f8
commit dfd7ba9c41

View File

@@ -88,6 +88,12 @@ class SosContactsViewModel extends Notifier<SosContactsViewState> {
}
Future<void> removeContact(int index) async {
if (state.contacts.length <= 1) {
state = state.copyWith(
errorMessage: I18n.sosMinimumOneContact,
);
return;
}
state = state.copyWith(isSaving: true, errorMessage: '');
try {