mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 19:28: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) {
|
if (res.error == ErrorCode.UserIdNotFound && contactId != null) {
|
||||||
Log.error('Contact deleted their account $contactId.');
|
Log.error('Contact deleted their account $contactId.');
|
||||||
await twonlyDB.contactsDao.updateContact(
|
final contact = await twonlyDB.contactsDao
|
||||||
contactId,
|
.getContactByUserId(contactId)
|
||||||
const ContactsCompanion(
|
.getSingleOrNull();
|
||||||
deleted: Value(true),
|
if (contact != null) {
|
||||||
),
|
await twonlyDB.contactsDao.updateContact(
|
||||||
);
|
contactId,
|
||||||
|
ContactsCompanion(
|
||||||
|
deleted: const Value(true),
|
||||||
|
username: Value('${contact.username} (${contact.userId})'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue