From 915d19fbe8590102ed8a720266e89bd7b53e583c Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 25 Sep 2019 18:31:53 -0300 Subject: [PATCH] [FIX] Cancel upload and check failed upload (#1232) --- app/lib/methods/sendFileMessage.js | 2 +- app/views/RoomView/UploadProgress.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/lib/methods/sendFileMessage.js b/app/lib/methods/sendFileMessage.js index 12703afc..2b5bdf45 100644 --- a/app/lib/methods/sendFileMessage.js +++ b/app/lib/methods/sendFileMessage.js @@ -14,7 +14,7 @@ export async function cancelUpload(item) { uploadQueue[item.path].abort(); try { const db = database.active; - await db.database.action(async() => { + await db.action(async() => { await item.destroyPermanently(); }); } catch (e) { diff --git a/app/views/RoomView/UploadProgress.js b/app/views/RoomView/UploadProgress.js index d4f1c398..aa62f1b6 100644 --- a/app/views/RoomView/UploadProgress.js +++ b/app/views/RoomView/UploadProgress.js @@ -122,7 +122,8 @@ class UploadProgress extends Component { uploads.forEach(async(u) => { if (!RocketChat.isUploadActive(u.path)) { try { - await database.database.action(async() => { + const db = database.active; + await db.action(async() => { await u.update(() => { u.error = true; });