mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-05-25 02:12:13 +00:00
delete receipts where the message got deleted
This commit is contained in:
parent
e1956c9807
commit
2ec8d14439
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