mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-04-22 11:32:54 +00:00
delete receipts where the message got deleted
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
This commit is contained in:
parent
ad647a3a21
commit
75b9d3e379
1 changed files with 6 additions and 0 deletions
|
|
@ -102,6 +102,12 @@ Future<void> reuploadMediaFiles() async {
|
|||
.getMessageById(messageId)
|
||||
.getSingleOrNull();
|
||||
if (message == null || message.mediaId == null) {
|
||||
// The message or media file does not exists any more, so delete the receipt...
|
||||
if (message != null) {
|
||||
// The media file of the message does not exist anymore. Removing it...
|
||||
await twonlyDB.messagesDao.deleteMessagesById(messageId);
|
||||
}
|
||||
await twonlyDB.receiptsDao.deleteReceipt(receipt.receiptId);
|
||||
Log.error(
|
||||
'Message not found for reupload of the receipt (${message == null} - ${message?.mediaId}).',
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue