mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 07:48:40 +00:00
fix issue with username change after deletion
This commit is contained in:
parent
cb2f0d00a6
commit
402a8916f7
1 changed files with 12 additions and 6 deletions
|
|
@ -339,12 +339,18 @@ class ApiService {
|
|||
}
|
||||
if (res.error == ErrorCode.UserIdNotFound && contactId != null) {
|
||||
Log.error('Contact deleted their account $contactId.');
|
||||
await twonlyDB.contactsDao.updateContact(
|
||||
contactId,
|
||||
const ContactsCompanion(
|
||||
deleted: Value(true),
|
||||
),
|
||||
);
|
||||
final contact = await twonlyDB.contactsDao
|
||||
.getContactByUserId(contactId)
|
||||
.getSingleOrNull();
|
||||
if (contact != null) {
|
||||
await twonlyDB.contactsDao.updateContact(
|
||||
contactId,
|
||||
ContactsCompanion(
|
||||
deleted: const Value(true),
|
||||
username: Value('${contact.username} (${contact.userId})'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
|
|
|||
Loading…
Reference in a new issue