mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-24 07:00:47 -04:00
ui cleanup
This commit is contained in:
parent
d460a0388c
commit
77c68aa45f
57 changed files with 1158 additions and 914 deletions
|
@ -8,6 +8,7 @@ import 'package:veilid_support/veilid_support.dart';
|
|||
import '../../account_manager/account_manager.dart';
|
||||
import '../../proto/proto.dart' as proto;
|
||||
import '../../tools/tools.dart';
|
||||
import '../models/models.dart';
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Mutable state for per-account contacts
|
||||
|
@ -81,9 +82,7 @@ class ContactListCubit extends DHTShortArrayCubit<proto.Contact> {
|
|||
|
||||
Future<void> updateContactFields({
|
||||
required TypedKey localConversationRecordKey,
|
||||
String? nickname,
|
||||
String? notes,
|
||||
bool? showAvailability,
|
||||
required ContactSpec updatedContactSpec,
|
||||
}) async {
|
||||
// Update contact's locally-modifiable fields
|
||||
await operateWriteEventual((writer) async {
|
||||
|
@ -92,17 +91,7 @@ class ContactListCubit extends DHTShortArrayCubit<proto.Contact> {
|
|||
if (c != null &&
|
||||
c.localConversationRecordKey.toVeilid() ==
|
||||
localConversationRecordKey) {
|
||||
final newContact = c.deepCopy();
|
||||
|
||||
if (nickname != null) {
|
||||
newContact.nickname = nickname;
|
||||
}
|
||||
if (notes != null) {
|
||||
newContact.notes = notes;
|
||||
}
|
||||
if (showAvailability != null) {
|
||||
newContact.showAvailability = showAvailability;
|
||||
}
|
||||
final newContact = await updatedContactSpec.updateProto(c);
|
||||
|
||||
final updated = await writer.tryWriteItemProtobuf(
|
||||
proto.Contact.fromBuffer, pos, newContact);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue