progress on dht_log

This commit is contained in:
Christien Rioux 2024-05-13 10:03:25 -04:00
parent ab4f05a347
commit c4d25fecb0
36 changed files with 1754 additions and 502 deletions

View file

@ -70,7 +70,7 @@ class ContactListCubit extends DHTShortArrayCubit<proto.Contact> {
contact.remoteConversationRecordKey.toVeilid();
// Remove Contact from account's list
final (deletedItem, success) = await operateWrite((writer) async {
final deletedItem = await operateWrite((writer) async {
for (var i = 0; i < writer.length; i++) {
final item = await writer.getItemProtobuf(proto.Contact.fromBuffer, i);
if (item == null) {
@ -78,16 +78,14 @@ class ContactListCubit extends DHTShortArrayCubit<proto.Contact> {
}
if (item.remoteConversationRecordKey ==
contact.remoteConversationRecordKey) {
if (await writer.tryRemoveItem(i) != null) {
return item;
}
return null;
await writer.removeItem(i);
return item;
}
}
return null;
});
if (success && deletedItem != null) {
if (deletedItem != null) {
try {
// Make a conversation cubit to manipulate the conversation
final conversationCubit = ConversationCubit(